diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 37f84012df3..09e5152ca3a 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1233,7 +1233,7 @@ class ExtraFields $InfoFieldList[4] = str_replace('$ID$', '0', $InfoFieldList[4]); } //We have to join on extrafield table - if (strpos($InfoFieldList[4], 'extra') !== false) { + if (strpos($InfoFieldList[4], 'extra.') !== false) { $sql .= ' as main, '.$this->db->prefix().$InfoFieldList[0].'_extrafields as extra'; $sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4]; } else { @@ -1690,7 +1690,7 @@ class ExtraFields $sql = "SELECT ".$keyList; $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; - if (!empty($InfoFieldList[4]) && strpos($InfoFieldList[4], 'extra') !== false) { + if (!empty($InfoFieldList[4]) && strpos($InfoFieldList[4], 'extra.') !== false) { $sql .= ' as main'; } if ($selectkey == 'rowid' && empty($value)) { @@ -1806,7 +1806,7 @@ class ExtraFields $sql = "SELECT ".$keyList; $sql .= " FROM ".$this->db->prefix().$InfoFieldList[0]; - if (strpos($InfoFieldList[4], 'extra') !== false) { + if (strpos($InfoFieldList[4], 'extra.') !== false) { $sql .= ' as main'; } // $sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'";