? Success
Pull Request for # 5734

User tests: Successful: Unsuccessful:

avatar JoomliC
JoomliC
15 Jan 2015

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.
avatar JoomliC JoomliC - open - 15 Jan 2015
avatar jissues-bot jissues-bot - change - 15 Jan 2015
Labels Added: ?
avatar brianteeman brianteeman - change - 15 Jan 2015
Category Multilanguage
avatar brianteeman brianteeman - change - 15 Jan 2015
Rel_Number 5734
Relation Type Pull Request for
avatar richard67
richard67 - comment - 15 Jan 2015

@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.
avatar JoomliC
JoomliC - comment - 16 Jan 2015

@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...)

avatar brianteeman
brianteeman - comment - 16 Jan 2015

(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??

avatar JoomliC JoomliC - change - 16 Jan 2015
Title
Fix article language filter in category (issue reported here : https://github.com/joomla/joomla-cms/issues/5734)
Fix filter language in category (issue reported here : https://github.com/joomla/joomla-cms/issues/5734)
avatar JoomliC
JoomliC - comment - 16 Jan 2015

@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...)

avatar infograf768
infograf768 - comment - 16 Jan 2015

@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?

avatar toslan
toslan - comment - 16 Jan 2015

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


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5740.
avatar toslan toslan - test_item - 16 Jan 2015 - Tested unsuccessfully
avatar toslan
toslan - comment - 16 Jan 2015

Sorry, this is the right ref for my previous comment: #5756


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5740.
avatar JoomliC
JoomliC - comment - 16 Jan 2015
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 ?

avatar JoomliC JoomliC - close - 16 Jan 2015
avatar JoomliC JoomliC - change - 16 Jan 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-01-16 13:19:53
avatar toslan
toslan - comment - 16 Jan 2015

@JoomliC Should I reopen #5734 and close #5756 ? How to move the code there? Sorry I am new to all this staff


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5740.
avatar JoomliC
JoomliC - comment - 16 Jan 2015

@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 :+1:

Add a Comment

Login with GitHub to post a comment