From 0448a5b32cd69dfdced339cb7bad0cbc5b940c53 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 19 Jan 2009 06:02:53 +0000 Subject: Flush the access_intent cache after ALTER TABLE queries, fixes a problem where the install.sql had the wrong view permissions. --- core/helpers/access.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/helpers') diff --git a/core/helpers/access.php b/core/helpers/access.php index 4aba5e9a..23db5782 100644 --- a/core/helpers/access.php +++ b/core/helpers/access.php @@ -406,6 +406,7 @@ class access_Core { $cache_table = $perm_name == "view" ? "items" : "access_caches"; $db->query("ALTER TABLE `$cache_table` DROP `$field`"); $db->query("ALTER TABLE `access_intents` DROP `$field`"); + ORM::factory("access_intent")->clear_cache(); } /** @@ -422,6 +423,7 @@ class access_Core { $db->query("ALTER TABLE `$cache_table` ADD `$field` TINYINT(2) NOT NULL DEFAULT 0"); $db->query("ALTER TABLE `access_intents` ADD `$field` BOOLEAN DEFAULT NULL"); $db->query("UPDATE `access_intents` SET `$field` = 0 WHERE `item_id` = 1"); + ORM::factory("access_intent")->clear_cache(); } /** -- cgit v1.2.3