Fix can't disable a module that were removed.

This commit is contained in:
Laurent Destailleur
2015-09-04 16:47:43 +02:00
parent 9422b22edb
commit dcaef54f9b
2 changed files with 11 additions and 5 deletions

View File

@@ -838,13 +838,13 @@ function unActivateModule($value, $requiredby=1)
}
else
{
// TODO Replace this afte DolibarrModules is moved as abstract class with a try catch to show module is bugged
// TODO Replace this after DolibarrModules is moved as abstract class with a try catch to show module is bugged
$genericMod = new DolibarrModules($db);
$genericMod->name=preg_replace('/^mod/i','',$modName);
$genericMod->rights_class=strtolower(preg_replace('/^mod/i','',$modName));
$genericMod->const_name='MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',$modName));
dol_syslog("modules::unActivateModule Failed to find module file, we use generic function with name " . $modName);
$genericMod->_remove();
$genericMod->_remove('');
}
// Desactivation des modules qui dependent de lui
@@ -853,6 +853,7 @@ function unActivateModule($value, $requiredby=1)
$countrb=count($objMod->requiredby);
for ($i = 0; $i < $countrb; $i++)
{
var_dump($objMod->requiredby[$i]);
unActivateModule($objMod->requiredby[$i]);
}
}