From dd7febe2b984f0ab2c60d435279e3a0a6374a5c0 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Fri, 29 May 2015 15:10:59 +0200 Subject: [PATCH] replace test by getEntity() --- htdocs/core/class/commonobject.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 10e83d80595..03d044a2ee6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -69,9 +69,7 @@ abstract class CommonObject $sql = "SELECT rowid, ref, ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX.$element; - - if($conf->multicompany->enabled)$sql.= " WHERE entity=".$conf->entity; - else $sql.=" WHERE 1 "; + $sql.= " WHERE entity IN (".getEntity($element).")" ; if ($id > 0) $sql.= " AND rowid = ".$db->escape($id); else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'";