Index: branches/5.2.x/core/units/categories/categories_tag_processor.php =================================================================== diff -u -N -r14474 -r14585 --- branches/5.2.x/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 14474) +++ branches/5.2.x/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 14585) @@ -1,6 +1,6 @@ Application->getPhysicalTemplate('id:' . $category_id); + if ( ($physical_template !== false) && preg_match('/external:(.*)/', $physical_template, $rets) ) { + // external url + return $rets[1]; + } + + unset($params['cat_id'], $params['module']); $new_params = Array ('pass' => 'm', 'm_cat_id' => $category_id, 'pass_category' => 1); $params = array_merge($params, $new_params); @@ -455,16 +461,16 @@ function GetParentCategory($params) { - $parent_id = 0; - $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); - $table = $this->Application->getUnitOption($this->Prefix,'TableName'); - $cat_id = $this->Application->GetVar('m_cat_id'); - if ($cat_id > 0) { + $parent_id = $this->Application->getBaseCategory(); + $category_id = $this->Application->GetVar('m_cat_id'); + + if ($category_id != $parent_id) { $sql = 'SELECT ParentId - FROM '.$table.' - WHERE '.$id_field.' = '.$cat_id; + FROM ' . $this->Application->getUnitOption($this->Prefix, 'TableName') . ' + WHERE ' . $this->Application->getUnitOption($this->Prefix, 'IDField') . ' = ' . $category_id; $parent_id = $this->Conn->GetOne($sql); } + return $parent_id; } @@ -512,6 +518,9 @@ else { // all done, update left tree and redirect $updater->SaveData(); + + $this->Application->HandleEvent($event, 'c:OnResetCMSMenuCache'); + $this->Application->RemoveVar('PermCache_UpdateRequired'); $this->Application->StoreVar('RefreshStructureTree', 1); $this->Application->Redirect($params['destination_template']);