[-] BO : module tab crashed when trying to update a module that wasn't loaded (because of the XML cache file)

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15392 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dMetzger
2012-05-18 15:20:05 +00:00
parent 98ff09c8ee
commit b9026f8241
+7 -1
View File
@@ -1055,7 +1055,10 @@ class AdminModulesControllerCore extends AdminController
// Upgrade Module process, init check if a module could be upgraded
if (Module::initUpgradeModule($module->name, $module->version))
{
if ($object = new $module->name())
// When the XML cache file is up-to-date, the module may not be loaded yet
if (!class_exists($module->name))
require_once(_PS_MODULE_DIR_.$module->name.'/'.$module->name.'.php');
if ($object = new $module->name)
{
$object->runUpgradeModule();
if ((count($errors_module_list = $object->getErrors())))
@@ -1069,6 +1072,9 @@ class AdminModulesControllerCore extends AdminController
// User has to be prevented
else if (Module::getUpgradeStatus($module->name))
{
// When the XML cache file is up-to-date, the module may not be loaded yet
if (!class_exists($module->name))
require_once(_PS_MODULE_DIR_.$module->name.'/'.$module->name.'.php');
$object = new $module->name();
$module_success[] = array('name' => $module->name, 'message' => array(
0 => $this->l('Current version:').$object->version,