Fix delete_module_parts with multicompagny (#25411)

This commit is contained in:
Florent Poinsaut
2023-07-23 19:48:59 +02:00
committed by GitHub
parent da473131ad
commit 47ea0c274b

View File

@@ -2346,7 +2346,6 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
global $conf; global $conf;
$err = 0; $err = 0;
$entity = $conf->entity;
if (is_array($this->module_parts) && !empty($this->module_parts)) { if (is_array($this->module_parts) && !empty($this->module_parts)) {
dol_syslog(get_class($this)."::delete_module_parts", LOG_DEBUG); dol_syslog(get_class($this)."::delete_module_parts", LOG_DEBUG);
@@ -2355,6 +2354,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
// If entity is defined // If entity is defined
if (is_array($value) && isset($value['entity'])) { if (is_array($value) && isset($value['entity'])) {
$entity = $value['entity']; $entity = $value['entity'];
} else {
$entity = $conf->entity;
} }
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."const";