From 2ce44b6b08f4623da872574867f7b7498ef5a1c4 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 11 Mar 2009 00:27:17 +0000 Subject: Fix the Var_Test by making sure that the cache is cleared or updated when a variable is set or cleared. --- core/helpers/module.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'core/helpers/module.php') diff --git a/core/helpers/module.php b/core/helpers/module.php index 190cec73..82c69627 100644 --- a/core/helpers/module.php +++ b/core/helpers/module.php @@ -248,8 +248,9 @@ class module_Core { $var->name = $name; } $var->value = $value; - $var->save(); - } + $var->save(); + self::$var_cache[$module_name][$name] = $value; + } /** * Increment the value of a variable for this module @@ -262,6 +263,7 @@ class module_Core { "UPDATE {vars} SET `value` = `value` + $increment " . "WHERE `module_name` = '$module_name' " . "AND `name` = '$name'"); + unset(self::$var_cache[$module_name][$name]); } /** @@ -277,5 +279,6 @@ class module_Core { if ($var->loaded) { $var->delete(); } + unset(self::$var_cache[$module_name][$name]); } } -- cgit v1.2.3