diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index d261af08416f9a07c7ee376fff76ec072bf1de49..6b21283c2f73bc927ef51d72db4baff70b69dada 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -703,6 +703,7 @@ class ExtraFields $sql = 'SELECT '.$keyList.', '.$InfoFieldList[1]; $sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0]; + $sql.= ' WHERE entity = '.$conf->entity; dol_syslog(get_class($this).':showInputField:$type=sellist sql='.$sql); $resql = $this->db->query($sql); @@ -839,7 +840,8 @@ class ExtraFields $sql = 'SELECT '.$InfoFieldList[1]; $sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0]; - $sql.= ' where '.$keyList.'="'.$this->db->escape($value).'"'; + $sql.= ' WHERE '.$keyList.'="'.$this->db->escape($value).'"'; + $sql.= ' AND entity = '.$conf->entity; dol_syslog(get_class($this).':showOutputField:$type=sellist sql='.$sql); $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 18ea7623d6680df943b3b4dee820a3431bce18ff..25c8ede2227da9604bce13c329e94812a258045e 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -67,7 +67,8 @@ if((($type == 'select') || ($type == 'checkbox') ||(($type == 'radio'))) && is_a } } }elseif ($type== 'sellist') { - $param_chain = array_keys($param['options'])[0]; + $paramlist=array_keys($param['options']); + $param_chain = $paramlist[0]; } ?> <!-- Position -->