Fix: missing entity

This commit is contained in:
Regis Houssin 2012-03-03 20:19:21 +01:00
parent 0dbef2d784
commit bbbca891f8

View File

@ -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))