Index: trunk/core/units/general/cat_event_handler.php =================================================================== diff -u -N -r8546 -r8562 --- trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 8546) +++ trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 8562) @@ -360,9 +360,15 @@ if ((string) $parent_cat_id != 'any') { if ($event->getEventParam('recursive')) { - $current_path = $this->Conn->GetOne('SELECT ParentPath FROM '.TABLE_PREFIX.'Category WHERE CategoryId='.$parent_cat_id); - $subcats = $this->Conn->GetCol('SELECT CategoryId FROM '.TABLE_PREFIX.'Category WHERE ParentPath LIKE "'.$current_path.'%" '); - $object->addFilter('category_filter', TABLE_PREFIX.'CategoryItems.CategoryId IN ('.implode(', ', $subcats).')'); + if ($parent_cat_id > 0) { + // not "Home" category + $sql = 'SELECT TreeLeft, TreeRight + FROM '.TABLE_PREFIX.'Category + WHERE CategoryId = '.$parent_cat_id; + $tree_indexes = $this->Conn->GetRow($sql); + + $object->addFilter('category_filter', TABLE_PREFIX.'Category.TreeLeft BETWEEN '.$tree_indexes['TreeLeft'].' AND '.$tree_indexes['TreeRight']); + } $object->addFilter('primary_filter', 'PrimaryCat = 1'); } else {