diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index ceca4575f50..1d24a8b55c1 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -677,49 +677,52 @@ class ExtraFields } elseif ($type == 'sellist') { + $out=''; } @@ -824,23 +827,25 @@ class ExtraFields } elseif ($type == 'sellist') { - $param_list=array_keys($params['options']); - $InfoFieldList = explode(":", $param_list[0]); - $keyList='rowid'; - if (count($InfoFieldList)==3) - $keyList=$InfoFieldList[2]; - - - $sql = 'SELECT '.$InfoFieldList[1]; - $sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0]; - $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) - { - $obj = $this->db->fetch_object($resql); - $value=$obj->$InfoFieldList[1]; + if (is_array($params['options'])) { + $param_list=array_keys($params['options']); + $InfoFieldList = explode(":", $param_list[0]); + $keyList='rowid'; + if (count($InfoFieldList)==3) + $keyList=$InfoFieldList[2]; + + + $sql = 'SELECT '.$InfoFieldList[1]; + $sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0]; + $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) + { + $obj = $this->db->fetch_object($resql); + $value=$obj->$InfoFieldList[1]; + } } } elseif ($type == 'radio')