Index: branches/5.2.x/core/units/helpers/count_helper.php =================================================================== diff -u -r14699 -r15012 --- branches/5.2.x/core/units/helpers/count_helper.php (.../count_helper.php) (revision 14699) +++ branches/5.2.x/core/units/helpers/count_helper.php (.../count_helper.php) (revision 15012) @@ -1,6 +1,6 @@ 0) { // get subcategories of required category $tmp_sql = 'SELECT TreeLeft, TreeRight - FROM '.TABLE_PREFIX.'Category + FROM '.TABLE_PREFIX.'Categories WHERE CategoryId = '.$category_id; $tree_info = $this->Conn->GetRow($tmp_sql); $where_clauses[] = 'c.TreeLeft BETWEEN '.$tree_info['TreeLeft'].' AND '.$tree_info['TreeRight']; @@ -188,8 +188,8 @@ $sql = 'SELECT '.$count_sql.' FROM '.$table_name.' item_table INNER JOIN '.TABLE_PREFIX.'CategoryItems ci ON ci.ItemResourceId = item_table.ResourceId - INNER JOIN '.TABLE_PREFIX.'Category c ON c.CategoryId = ci.CategoryId - INNER JOIN '.TABLE_PREFIX.'PermCache perm_cache ON ci.CategoryId = perm_cache.CategoryId'; + INNER JOIN '.TABLE_PREFIX.'Categories c ON c.CategoryId = ci.CategoryId + INNER JOIN '.TABLE_PREFIX.'CategoryPermissionsCache perm_cache ON ci.CategoryId = perm_cache.CategoryId'; list ($view_perm, $view_filter) = $this->GetPermissionClause($prefix, 'perm_cache'); $where_clauses = Array ( @@ -226,7 +226,7 @@ if ($count === false) { $sql = 'SELECT COUNT(*) FROM ' . $this->Application->getUnitOption('c', 'TableName') . ' c - INNER JOIN ' . TABLE_PREFIX . 'PermCache perm_cache ON c.CategoryId = perm_cache.CategoryId'; + INNER JOIN ' . TABLE_PREFIX . 'CategoryPermissionsCache perm_cache ON c.CategoryId = perm_cache.CategoryId'; list ($view_perm, $view_filter) = $this->GetPermissionClause('c', 'perm_cache'); @@ -267,7 +267,7 @@ $this->Conn->nextQueryCachable = true; $sql = 'SELECT PermissionConfigId, PermissionName - FROM '.TABLE_PREFIX.'PermissionConfig + FROM '.TABLE_PREFIX.'CategoryPermissionsConfig WHERE PermissionName LIKE "%.VIEW"'; $permissions_ids = $this->Conn->GetCol($sql, 'PermissionName');