Index: branches/RC/core/units/general/helpers/mod_rewrite_helper.php =================================================================== diff -u -r8929 -r8984 --- branches/RC/core/units/general/helpers/mod_rewrite_helper.php (.../mod_rewrite_helper.php) (revision 8929) +++ branches/RC/core/units/general/helpers/mod_rewrite_helper.php (.../mod_rewrite_helper.php) (revision 8984) @@ -226,10 +226,13 @@ function GetItemTemplate($category, $module_prefix) { if (!is_array($category)) { - $category = $this->Conn->GetRow(' - SELECT c.ParentPath, c.CategoryId FROM '.TABLE_PREFIX.'Category AS c - WHERE - c.CategoryId = '.$category); + if ($category == 0) { + $category = $this->Application->findModule('Var', $module_prefix, 'RootCat'); + } + $sql = 'SELECT c.ParentPath, c.CategoryId + FROM '.TABLE_PREFIX.'Category AS c + WHERE c.CategoryId = '.$category; + $category = $this->Conn->GetRow($sql); } $parent_path = implode(',',explode('|', substr($category['ParentPath'], 1, -1)));