diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index d59e3c9a864..e7630756127 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -838,13 +838,14 @@ 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 + //print $dir.$modFile; + // TODO Replace this after DolibarrModules is moved as abstract class with a try catch to show module we try to disable has not been found or could not be loaded $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(array()); } // Desactivation des modules qui dependent de lui diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 0de1c7ab4ab..4bf274d0249 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -32,7 +32,7 @@ * * Parent class for module descriptor class files */ -abstract class DolibarrModules +class DolibarrModules { /** * @var DoliDb Database handler @@ -199,10 +199,14 @@ abstract class DolibarrModules * * @param DoliDB $db Database handler */ - //public function __construct($db); + public function __construct($db) + { + $this->db = $db; + } // We should but can't set this as abstract because this will make dolibarr hang // after migration due to old module not implementing. We must wait PHP is able to make // a try catch on Fatal error to manage this correctly. + // We need constructor into function unActivateModule into admin.lib.php /** * Enables a module.