Index: trunk/core/units/general/cat_dbitem_export.php =================================================================== diff -u -r3797 -r3812 --- trunk/core/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 3797) +++ trunk/core/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 3812) @@ -1,7 +1,7 @@ Application->GetVar('m_cat_id'); - - foreach ($this->curItem->CategoryPath as $category_name) { + + foreach ($this->curItem->CategoryPath as $category_index => $category_name) { if (!$category_name) continue; - $category_id = $this->getFromCache('category_names', $category_name); + $category_key = crc32( implode(':', array_slice($this->curItem->CategoryPath, 0, $category_index + 1) ) ); + + $category_id = $this->getFromCache('category_names', $category_key); if ($category_id === false) { // get parent category path to search only in it $current_category_id = $this->Application->GetVar('m_cat_id'); @@ -674,11 +676,11 @@ if ($this->dummyCategory->Create()) { $category_id = $this->dummyCategory->GetID(); $this->addToCache('category_parent_path', $category_id, $this->dummyCategory->GetDBField('ParentPath')); - $this->addToCache('category_names', $category_name, $category_id); + $this->addToCache('category_names', $category_key, $category_id); } } else { - $this->addToCache('category_names', $category_name, $category_id); + $this->addToCache('category_names', $category_key, $category_id); } } @@ -689,7 +691,7 @@ if (!$this->curItem->CategoryPath) { $category_id = $backup_category_id; } - + // create main record if ($save_method == 'Create') { $this->fillRequiredFields($this->false, $this->curItem, true); @@ -716,7 +718,7 @@ $this->Application->SetVar('m_cat_id', $backup_category_id); return true; } - + /** * Returns category parent path, if possible, then from cache *