Index: branches/unlabeled/unlabeled-1.14.2/kernel/units/general/cat_dbitem_export.php =================================================================== diff -u -r4164 -r4167 --- branches/unlabeled/unlabeled-1.14.2/kernel/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 4164) +++ branches/unlabeled/unlabeled-1.14.2/kernel/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 4167) @@ -657,6 +657,13 @@ function getItemCategory() { $backup_category_id = $this->Application->GetVar('m_cat_id'); + + $category_id = $this->getFromCache('category_names', implode(':', $this->curItem->CategoryPath)); + if ($category_id) { + $this->Application->SetVar('m_cat_id', $category_id); + return $category_id; + } + foreach ($this->curItem->CategoryPath as $category_index => $category_name) { if (!$category_name) continue; $category_key = crc32( implode(':', array_slice($this->curItem->CategoryPath, 0, $category_index + 1) ) ); @@ -665,12 +672,12 @@ if ($category_id === false) { // get parent category path to search only in it $current_category_id = $this->Application->GetVar('m_cat_id'); - $parent_path = $this->getParentPath($current_category_id); +// $parent_path = $this->getParentPath($current_category_id); // 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.'%") AND (ParentPath <> "'.$parent_path.'")'; + WHERE (Name = '.$this->Conn->qstr($category_name).') AND (ParentId = '.$current_category_id.')'; $category_id = $this->Conn->GetOne($sql); if ($category_id === false) { Index: branches/unlabeled/unlabeled-1.14.2/core/units/general/cat_dbitem_export.php =================================================================== diff -u -r4164 -r4167 --- branches/unlabeled/unlabeled-1.14.2/core/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 4164) +++ branches/unlabeled/unlabeled-1.14.2/core/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 4167) @@ -657,6 +657,13 @@ function getItemCategory() { $backup_category_id = $this->Application->GetVar('m_cat_id'); + + $category_id = $this->getFromCache('category_names', implode(':', $this->curItem->CategoryPath)); + if ($category_id) { + $this->Application->SetVar('m_cat_id', $category_id); + return $category_id; + } + foreach ($this->curItem->CategoryPath as $category_index => $category_name) { if (!$category_name) continue; $category_key = crc32( implode(':', array_slice($this->curItem->CategoryPath, 0, $category_index + 1) ) ); @@ -665,12 +672,12 @@ if ($category_id === false) { // get parent category path to search only in it $current_category_id = $this->Application->GetVar('m_cat_id'); - $parent_path = $this->getParentPath($current_category_id); +// $parent_path = $this->getParentPath($current_category_id); // 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.'%") AND (ParentPath <> "'.$parent_path.'")'; + WHERE (Name = '.$this->Conn->qstr($category_name).') AND (ParentId = '.$current_category_id.')'; $category_id = $this->Conn->GetOne($sql); if ($category_id === false) {