From 201a94b550ab40465c827fdfd473daabc7eade5c Mon Sep 17 00:00:00 2001 From: jyhere Date: Fri, 3 Feb 2023 13:11:17 +0100 Subject: [PATCH] [FIX] sellist / chkboxlist extrafields error when table is _extrafields This patch fixes error when an sellist /chkboxlist extrafield directly use an *_extrafields table (as main table) --- htdocs/core/class/extrafields.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)."'";