diff options
Diffstat (limited to 'core/helpers/access.php')
-rw-r--r-- | core/helpers/access.php | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/core/helpers/access.php b/core/helpers/access.php index e859b1d5..4c623f7c 100644 --- a/core/helpers/access.php +++ b/core/helpers/access.php @@ -64,8 +64,6 @@ * o In the near future, we'll be moving the "view" columns out of Access_Intent_Model and * directly into Item_Model. By doing this, we'll be able to find viewable items (the most * common permission access) without doing table joins. - * - * o Write unit tests. */ class access_Core { const DENY = 0; @@ -403,12 +401,11 @@ class access_Core { $query = $db->query( "SELECT `access_intents`.`$field`, `items`.`left`, `items`.`right` " . "FROM `access_intents` JOIN (`items`) ON (`access_intents`.`item_id` = `items`.`id`) " . - "WHERE `left` >= ? " . - "AND `right` <= ? " . + "WHERE `left` >= $item->left " . + "AND `right` <= $item->right " . "AND `type` = 'album' " . "AND `$field` IS NOT NULL " . - "ORDER BY `level` ASC ", - array($item->left, $item->right)); + "ORDER BY `level` ASC"); foreach ($query as $row) { $db->query( "UPDATE `access_caches` SET `$field` = {$row->$field} " . |