diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 32f0790fd89..1a362d143dc 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -794,11 +794,7 @@ class ExtraFields // 4 : where clause filter on column or table extrafield, syntax field='value' or extra.field=value $keyList=(empty($InfoFieldList[2])?'rowid':$InfoFieldList[2].' as rowid'); - if (count($InfoFieldList) > 3 && ! empty($InfoFieldList[3])) - { - list($parentName, $parentField) = explode('|', $InfoFieldList[3]); - $keyList.= ', '.$parentField; - } + if (count($InfoFieldList) > 4 && ! empty($InfoFieldList[4])) { if (strpos($InfoFieldList[4], 'extra.') !== false) @@ -808,6 +804,11 @@ class ExtraFields $keyList=$InfoFieldList[2].' as rowid'; } } + if (count($InfoFieldList) > 3 && ! empty($InfoFieldList[3])) + { + list($parentName, $parentField) = explode('|', $InfoFieldList[3]); + $keyList.= ', '.$parentField; + } $fields_label = explode('|',$InfoFieldList[1]); if (is_array($fields_label))