Change the upgrader so that it never deactivactes the gallery nor the current identity provider modules. Call module::deactive to truly deactivate the module.

This commit is contained in:
Tim Almdal
2009-10-26 09:35:41 -07:00
parent 6fb116c53b
commit e4eedbce22
2 changed files with 14 additions and 11 deletions

View File

@@ -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) {