Index: mod_rewrite_helper.php =================================================================== --- mod_rewrite_helper.php (revision 9) +++ mod_rewrite_helper.php (working copy) @@ -856,14 +856,16 @@ // item template is stored in module' system custom field - need to get that field Id $item_template_field_id = $this->_getItemTemplateCustomField($module_prefix); + $primary_lang = $this->Application->GetDefaultLanguageId(); + // looking for item template through cats hierarchy sorted by parent path - $query = ' SELECT ccd.l1_cust_' . $item_template_field_id . ', + $query = ' SELECT ccd.l'.$primary_lang.'_cust_' . $item_template_field_id . ', FIND_IN_SET(c.CategoryId, ' . $this->Conn->qstr($parent_path) . ') AS Ord1, - c.CategoryId, c.Name, ccd.l1_cust_' . $item_template_field_id . ' + c.CategoryId, c.Name, ccd.l'.$primary_lang.'_cust_' . $item_template_field_id . ' FROM ' . TABLE_PREFIX . 'Category AS c LEFT JOIN ' . TABLE_PREFIX . 'CategoryCustomData AS ccd ON ccd.ResourceId = c.ResourceId - WHERE c.CategoryId IN (' . $parent_path . ') AND ccd.l1_cust_' . $item_template_field_id . ' != \'\' + WHERE c.CategoryId IN (' . $parent_path . ') AND ccd.l'.$primary_lang.'_cust_' . $item_template_field_id . ' != \'\' ORDER BY FIND_IN_SET(c.CategoryId, ' . $this->Conn->qstr($parent_path) . ') DESC'; $item_template = $this->Conn->GetOne($query);