Skip to content

Commit

Permalink
JCategories Fatal error: Call to a member function getChildren() on a…
Browse files Browse the repository at this point in the history
… non-object fixed #6064
  • Loading branch information
compojoom committed Mar 15, 2015
1 parent e9dbd50 commit bfc7829
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libraries/legacy/categories/categories.php
Expand Up @@ -344,7 +344,9 @@ protected function _load($id)
$this->_nodes[$result->id]->setParent($this->_nodes[$result->parent_id]);
}

if (!isset($this->_nodes[$result->parent_id]))
// If the node's parent id is not in the _nodes list and the node is not root (doesn't have parent_id == 0),
// then remove the node from the list
if (!(isset($this->_nodes[$result->parent_id]) || $result->parent_id == 0))
{
unset($this->_nodes[$result->id]);
continue;
Expand Down

0 comments on commit bfc7829

Please sign in to comment.