summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/module.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-10-26 09:35:41 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-10-26 09:35:41 -0700
commite4eedbce2298535540cb651d75ba6f1bf42cf02b (patch)
tree767cc2f81ef2abfacb0d5d3a8df464a65cf65c45 /modules/gallery/helpers/module.php
parent6fb116c53be947018e02de933d724273e76a251d (diff)
Change the upgrader so that it never deactivactes the gallery nor the current identity provider modules. Call module::deactive to truly deactivate the module.
Diffstat (limited to 'modules/gallery/helpers/module.php')
-rw-r--r--modules/gallery/helpers/module.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php
index 9d41cd51..27bc3784 100644
--- a/modules/gallery/helpers/module.php
+++ b/modules/gallery/helpers/module.php
@@ -155,10 +155,6 @@ class module_Core {
* @param string $module_name
*/
static function upgrade($module_name) {
- $kohana_modules = Kohana::config("core.modules");
- $kohana_modules = array_unshift($kohana_modules, MODPATH . $module_name);
- Kohana::config_set("core.modules", $kohana_modules);
-
$version_before = module::get_version($module_name);
$installer_class = "{$module_name}_installer";
if (method_exists($installer_class, "upgrade")) {
@@ -171,11 +167,14 @@ class module_Core {
throw new Exception("@todo UNKNOWN_MODULE");
}
}
- module::load_modules();
- // Now the module is upgraded but inactive, so don't leave it in the active path
- array_shift($kohana_modules);
- Kohana::config_set("core.modules", $kohana_modules);
+ // Now the module is upgraded so deactivate it, but we can'it deactivae gallery or the
+ // current identity provider.
+ $identity_provider = module::get_var("gallery", "identity_provider", "user");
+ if (!in_array($module_name, array("gallery", $identity_provider)) ) {
+ self::deactivate($module_name);
+ }
+ module::load_modules();
$version_after = module::get_version($module_name);
if ($version_before != $version_after) {