Skip to content

Commit

Permalink
Merge pull request #8098 from infograf768/cat_filter_correction
Browse files Browse the repository at this point in the history
Regression: Multilanguage categories association broken: correcting #7998
  • Loading branch information
roland-d committed Oct 17, 2015
2 parents ce8b80a + 89db245 commit 3c88269
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions libraries/legacy/categories/categories.php
Expand Up @@ -257,13 +257,24 @@ protected function _load($id)
if ($id != 'root')
{
// Get the selected category
$query->join('LEFT', '#__categories AS s ON (s.lft <= c.lft AND s.rgt >= c.rgt) OR (s.lft > c.lft AND s.rgt < c.rgt)')
->where('s.id=' . (int) $id);
}
$query->where('s.id=' . (int) $id);

if ($app->isSite() && JLanguageMultilang::isEnabled())
if ($app->isSite() && JLanguageMultilang::isEnabled())
{
$query->join('LEFT', '#__categories AS s ON (s.lft < c.lft AND s.rgt > c.rgt AND c.language in (' . $db->quote(JFactory::getLanguage()->getTag())
. ',' . $db->quote('*') . ')) OR (s.lft >= c.lft AND s.rgt <= c.rgt)');
}
else
{
$query->join('LEFT', '#__categories AS s ON (s.lft <= c.lft AND s.rgt >= c.rgt) OR (s.lft > c.lft AND s.rgt < c.rgt)');
}
}
else
{
$query->where('c.language in (' . $db->Quote(JFactory::getLanguage()->getTag()) . ',' . $db->Quote('*') . ')');
if ($app->isSite() && JLanguageMultilang::isEnabled())
{
$query->where('c.language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')');
}
}

// Note: i for item
Expand Down

0 comments on commit 3c88269

Please sign in to comment.