diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 039918ea66c..add121b902e 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -308,6 +308,16 @@ class Entrepot extends CommonObject { global $conf; + dol_syslog(get_class($this)."::fetch id=".$id." ref=".$ref); + + // Check parameters + if (! $id && ! $ref) + { + $this->error='ErrorWrongParameters'; + dol_syslog(get_class($this)."::fetch ".$this->error); + return -1; + } + $sql = "SELECT rowid, fk_parent, ref as label, description, statut, lieu, address, zip, town, fk_pays as country_id"; $sql .= " FROM ".MAIN_DB_PREFIX."entrepot"; if ($id) @@ -320,7 +330,6 @@ class Entrepot extends CommonObject if ($ref) $sql.= " AND ref = '".$this->db->escape($ref)."'"; } - dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); if ($result) {