Skip to content
Snippets Groups Projects
Commit 688562a8 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix regression: We can't yet set method __construct of DolibarrModules

abstract because this break compatibility with a lot of external module
and generate FATAL errors after migration. Because PHP is not yet able
to manage try catch on FATAL error, we can't catch such error. Using
bstract on constructor is so postponed.
parent 0b9ed9a2
No related branches found
No related tags found
No related merge requests found
...@@ -837,13 +837,13 @@ function unActivateModule($value, $requiredby=1) ...@@ -837,13 +837,13 @@ function unActivateModule($value, $requiredby=1)
} }
else else
{ {
// TODO Cannot instantiate abstract class // TODO Replace this afte DolibarrModules is moved as abstract class with a try catch to show module is bugged
//$genericMod = new DolibarrModul($db); $genericMod = new DolibarrModules($db);
//$genericMod->name=preg_replace('/^mod/i','',$modName); $genericMod->name=preg_replace('/^mod/i','',$modName);
//$genericMod->rights_class=strtolower(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)); $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); 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 // Desactivation des modules qui dependent de lui
......
...@@ -199,7 +199,10 @@ abstract class DolibarrModules ...@@ -199,7 +199,10 @@ abstract class DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
abstract public function __construct($db); //public function __construct($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.
/** /**
* Enables a module. * Enables a module.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment