User tests: Successful: Unsuccessful:
Fix for issue reported here : #5734
Add check of parent category language
Steps to reproduce the issue Assume you have a multilanguage site with Lang1 and Lang2 languages activated in frontend. You have 2 menus to show content in Lang1 and Lang2 languages: MenuLang1 and MenuLang2. Create new category CatLang1 in backend category manager and assign Lang1 to it. Create new article ArtLang2 in this category and assign Lang2 to it. Add menu item showing just added category blog to each of menus (MenuLang1 and MenuLang2). Expected result On frontend only MenuLang1 item should show CatLang1 category but MenuLang2 should filter it out. No articles should be shown in CatLang1 since ArtLang2 has wrong language. Actual result Both MenuLang1 and MenuLang2 shows CatLang1 category. CatLang1 in MenuLang2 shows ArtLang2. Category is not filtered by language.
Labels |
Added:
?
|
Category | ⇒ | Multilanguage |
Rel_Number | ⇒ | 5734 | |
Relation Type | ⇒ | Pull Request for |
@richard67 you're right about the quote ;-)
But i wonder now if the issue is reported is really here, and not in the fact of filtering by language only if JLanguageMultilang::isEnabled() return true...
(because you can select language for content even if multilang is not activated...)
(because you can select language for content even if multilang is not activated...)
But does it do anything if you do? Isnt it just a tag/label for admin info and not actually usable in any way??
Title |
|
@brianteeman i'm very sorry, i was taking the issue in the wrong way... (shame on me!)
So, i have updated this PR to add filtering of parent category and subcategories by language (which is the main issue reported in #5734, but for articles, i don't have the issue...)
@test
If I follow exactly the instructions above,
Lang2 after patch: when I display the menu item tagged to Lang2 (blog for catlang1 containing an article lang2), I get a 404 .
Before patch I get "There are no articles in this category. etc.)
Lang1 after patch: When I display the same menu item tagged to Lang1 (for catlang1 containing an article lang2), I get "There are no articles in this category. etc.-in the language)
Before patch : same.
Is that what you want?
Still does not filter category since function getCategory() in /components/com_content/models/category.php returns it regardless of language selected.
Could you consider this patch?
#5734
Sorry, this is the right ref for my previous comment: #5756
If I follow exactly the instructions above, Lang2 after patch: when I display the menu item tagged to Lang2 (blog for catlang1 containing an article lang2), I get a 404 . Before patch, it displays the article Lang1 after patch: When I display the same menu item tagged to Lang1 (for catlang1 containing an article lang2), I get "There are no articles in this category. etc.-in the language) Before patch : same. Is that what you want?
Yes, it is, but needs testing too for subcategories.
About 404 "Category not found", to prevent this error page in frontend, a checking to not allow to create a menu in lang1 with parent category in lang2 could be added...
But @tosian the first reporter of the issue, has opened a new PR #5756 with maybe a better way of fixing this issue, so i will close this one.
@tosian, 3 PR, for one issue you have reported and for which you have a code to fix it... was maybe possible to update the first one ?
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-01-16 13:19:53 |
@JoomliC Should I reopen #5734 and close #5756 ? How to move the code there? Sorry I am new to all this staff
@toslan just let it at it is, it's okay! Only #5756 open
Just edit to remove the space tab at end of line, and add tabs before comment.
To help you in joomla code standard : http://joomla.github.io/coding-standards/
And welcome for your first PR #5756
@JoomliC Shouldn't it be "$db->quote(parent.language) . ',' . ..."?
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5740.