Index: branches/unlabeled/unlabeled-1.14.2/core/units/general/cat_dbitem_export.php =================================================================== diff -u -r4152 -r4164 --- branches/unlabeled/unlabeled-1.14.2/core/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 4152) +++ branches/unlabeled/unlabeled-1.14.2/core/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 4164) @@ -607,7 +607,7 @@ $this->curItem->CategoryPath = $value ? explode($this->exportOptions['CategorySeparator'], $value) : Array(); } elseif (substr($field_name, 0, 8) == 'Category') { - $this->curItem->CategoryPath[ (int)substr($field_name, 8) ] = $value; + $this->curItem->CategoryPath[ (int)substr($field_name, 8) - 1 ] = $value; } elseif (substr($field_name, 0, 20) == '__CATEGORY__Category') { $this->curItem->CategoryPath[ (int)substr($field_name, 20) ] = $value; @@ -670,7 +670,7 @@ // get category id from database by name $sql = 'SELECT CategoryId FROM '.TABLE_PREFIX.'Category - WHERE (Name = '.$this->Conn->qstr($category_name).') AND (ParentPath LIKE "'.$parent_path.'%")'; + WHERE (Name = '.$this->Conn->qstr($category_name).') AND (ParentPath LIKE "'.$parent_path.'%") AND (ParentPath <> "'.$parent_path.'")'; $category_id = $this->Conn->GetOne($sql); if ($category_id === false) {