2
0
forked from Wavyzz/dolibarr

fix the enabling of a dependency module already ON

If a depency module is already activated and we try to activate the parent, we got an error because the entry is already existing in the database.
This commit is contained in:
De Coninck Laurent
2017-02-16 09:26:18 +01:00
parent 04d73668cc
commit fd6c4fd4d0

View File

@@ -763,6 +763,11 @@ function activateModule($value,$withdeps=1)
return $ret;
}
$const_name = $objMod->const_name;
if(!empty($conf->global->$const_name)){
return $ret;
}
$result=$objMod->init();
if ($result <= 0)
{
@@ -784,7 +789,13 @@ function activateModule($value,$withdeps=1)
if (file_exists($dir.$objMod->depends[$i].".class.php"))
{
$resarray = activateModule($objMod->depends[$i]);
if (empty($resarray['errors'])) $activate = true;
if (empty($resarray['errors'])){
$activate = true;
}else{
foreach ($resarray['errors'] as $errorMessage){
dol_syslog($errorMessage, LOG_ERR);
}
}
break;
}
}