Skip to content

Commit

Permalink
Fix frontend subcategory language filter
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrezdev committed Jan 16, 2015
1 parent e39f405 commit 63fd58e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions components/com_content/models/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,22 @@ public function &getChildren()
$this->getCategory();
}

// Filter subcategories by language
if (count($this->_children) && $this->getState('filter.language'))
{
$children = array();

foreach ($this->_children as $id => $child)
{
if (in_array($child->language, array(JFactory::getLanguage()->getTag(), '*')))
{
$children[] = $child;
}
}

$this->_children = $children;
}

// Order subcategories
if (count($this->_children))
{
Expand Down

0 comments on commit 63fd58e

Please sign in to comment.