-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filtering categories by languade #5756
Conversation
Fix issue described here: joomla#5734
if (JLanguageMultilang::isEnabled()) | ||
{ | ||
$query->where('c.language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the tab after } for Travis to succeed ;-)
(no space at end of a line)
@test success! Before PR, categories were not filtered by language. PR tested with multi-language enabled, and with those settings :
Menus (Type: category list or category blog) :
Results with PR :
So, all is good! 👍 Cyril |
@@ -241,6 +241,11 @@ protected function _load($id) | |||
{ | |||
$query->where('c.published = 1'); | |||
} | |||
// Filter category by language |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will just add here before a new line, to separate the filter by language from the filter by state ;-)
Will test later. |
I came across with another issue related to category language filter. The Language switcher module uses path helper to compute associated URLs. Since inactive languages are now filtered out the URLs for category views cannot be computed this way. Moreover path helper always loads complete category views for all languages which is wasteful because users usually do not switch to different languages while browsing. |
Fix issue described here: #5734