diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 6c5c1496eec8f..678db0f95bd7a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2726,7 +2726,7 @@ function setIncoterms($id_incoterm, $location) { $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; $sql.= " SET fk_incoterms = ".($id_incoterm > 0 ? $id_incoterm : "null"); - $sql.= ", location_incoterms = '".($id_incoterm > 0 ? $this->db->escape($location) : "null")."'"; + $sql.= ", location_incoterms = ".($id_incoterm > 0 ? "'".$this->db->escape($location)."'" : "null"); $sql.= " WHERE rowid = " . $this->id; dol_syslog(get_class($this).'::setIncoterms', LOG_DEBUG); $resql=$this->db->query($sql);