Index: trunk/kernel/units/categories/categories_item.php =================================================================== diff -u -r4806 -r5163 --- trunk/kernel/units/categories/categories_item.php (.../categories_item.php) (revision 4806) +++ trunk/kernel/units/categories/categories_item.php (.../categories_item.php) (revision 5163) @@ -39,13 +39,16 @@ function buildParentPath() { $parent_id = $this->GetDBField('ParentId'); - - $cat_table = $this->Application->getUnitOption($this->Prefix, 'TableName'); - - $sql = 'SELECT ParentPath FROM '.$cat_table.' WHERE CategoryId = %s'; - $parent_path = $this->Conn->GetOne( sprintf($sql, $parent_id) ); - if(!$parent_path && $parent_id) $parent_path = '|'.$parent_id.'|'; - + + if ($parent_id == 0) { + $parent_path = '|'; + } + else { + $cat_table = $this->Application->getUnitOption($this->Prefix, 'TableName'); + $sql = 'SELECT ParentPath FROM '.$cat_table.' WHERE CategoryId = %s'; + $parent_path = $this->Conn->GetOne( sprintf($sql, $parent_id) ); + } + return $parent_path.$this->GetID().'|'; }