Index: branches/RC/core/units/categories/categories_item.php =================================================================== diff -u -r10098 -r10780 --- branches/RC/core/units/categories/categories_item.php (.../categories_item.php) (revision 10098) +++ branches/RC/core/units/categories/categories_item.php (.../categories_item.php) (revision 10780) @@ -88,12 +88,8 @@ if(!$filename) return $filename; $item_id = !$this->GetID() ? 0 : $this->GetID(); + $check_in_parent_cat_only = $item_id ? ' AND ParentId = '.$this->GetDBField("ParentId") : ''; - if ($item_id) { - $parent_cat_id = $this->GetDBField("ParentId"); - $check_in_parent_cat_only = ' AND ParentId = '.$parent_cat_id; - } - // check temp table $sql_temp = 'SELECT '.$this->IDField.' FROM '.$this->TableName.' WHERE Filename = '.$this->Conn->qstr($filename).$check_in_parent_cat_only; $found_temp_ids = $this->Conn->GetCol($sql_temp);