mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-11 17:53:50 -04:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user