Index: trunk/core/units/general/cat_dbitem_export.php =================================================================== diff -u -r3543 -r3616 --- trunk/core/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 3543) +++ trunk/core/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 3616) @@ -509,7 +509,7 @@ // create/update categories $backup_category_id = $this->Application->GetVar('m_cat_id'); - + foreach ($this->curItem->CategoryPath as $category_name) { if (!$category_name) continue; $category_id = $this->getFromCache('category_names', $category_name); @@ -545,6 +545,9 @@ $this->Application->SetVar('m_cat_id', $category_id); } } + if (!$this->curItem->CategoryPath) { + $category_id = $backup_category_id; + } // create main record $save_method = 'Create'; @@ -751,7 +754,7 @@ $category_path = $this->Conn->GetOne($sql); $category_path = explode('>', $category_path); - if ($this->exportOptions['IsBaseCategory'] ) { + if ($this->exportOptions['IsBaseCategory']) { $i = $this->exportOptions['BaseLevel']; while ($i > 0) { array_shift($category_path);