Index: branches/RC/core/units/categories/categories_item.php =================================================================== diff -u -r8929 -r9368 --- branches/RC/core/units/categories/categories_item.php (.../categories_item.php) (revision 8929) +++ branches/RC/core/units/categories/categories_item.php (.../categories_item.php) (revision 9368) @@ -88,13 +88,18 @@ if(!$filename) return $filename; $item_id = !$this->GetID() ? 0 : $this->GetID(); + + 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); + $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); // check live table - $sql_live = 'SELECT '.$this->IDField.' FROM '.$this->Application->GetLiveName($this->TableName).' WHERE Filename = '.$this->Conn->qstr($filename); + $sql_live = 'SELECT '.$this->IDField.' FROM '.$this->Application->GetLiveName($this->TableName).' WHERE Filename = '.$this->Conn->qstr($filename).$check_in_parent_cat_only; $found_live_ids = $this->Conn->GetCol($sql_live); $found_item_ids = array_unique( array_merge($found_temp_ids, $found_live_ids) );