FIX Missing where on entity

Conflicts:
	htdocs/core/class/commonobject.class.php
This commit is contained in:
Laurent Destailleur 2019-08-03 16:32:35 +02:00
parent 55e9335cd2
commit 25ee539f92

View File

@ -2054,6 +2054,7 @@ abstract class CommonObject
}
}
/**
* Define delivery address
* @deprecated
@ -7319,6 +7320,7 @@ abstract class CommonObject
if (!empty($id)) $sql.= ' WHERE rowid = '.$id;
elseif (!empty($ref)) $sql.= " WHERE ref = ".$this->quote($ref, $this->fields['ref']);
else $sql.=' WHERE 1 = 1'; // usage with empty id and empty ref is very rare
if (empty($id) && isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) $sql.=' AND entity IN ('.getEntity($this->table_element).')';
if ($morewhere) $sql.= $morewhere;
$sql.=' LIMIT 1'; // This is a fetch, to be sure to get only one record