Fix sql error

This commit is contained in:
Laurent Destailleur 2021-09-18 15:05:31 +02:00
parent 0bf213acac
commit 052511d081

View File

@ -1263,7 +1263,7 @@ abstract class CommonObject
if ($source == 'external' || $source == 'thirdparty') {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople t on ec.fk_socpeople = t.rowid";
}
$sql .= " WHERE ec.element_id =".$this->id;
$sql .= " WHERE ec.element_id =".((int) $this->id);
$sql .= " AND ec.fk_c_type_contact=tc.rowid";
$sql .= " AND tc.element='".$this->db->escape($this->element)."'";
if ($code) {