From bbbca891f843ce4fab90726627f9d1e2f21f92df Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 3 Mar 2012 20:19:21 +0100 Subject: [PATCH] Fix: missing entity --- htdocs/core/modules/DolibarrModules.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 9773e518896..22fab0bb46e 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1325,14 +1325,18 @@ abstract class DolibarrModules global $conf; $err=0; + $entity=$conf->entity; if (is_array($this->module_parts) && ! empty($this->module_parts)) { foreach($this->module_parts as $key => $value) { + // If entity is defined + if (is_array($value) && isset($value['entity'])) $entity = $value['entity']; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."const"; $sql.= " WHERE ".$this->db->decrypt('name')." LIKE '".$this->const_name."_".strtoupper($key)."'"; - $sql.= " AND entity = ".$conf->entity; + $sql.= " AND entity = ".$entity; dol_syslog(get_class($this)."::delete_const_".$key." sql=".$sql); if (! $this->db->query($sql))