From 18a6ed17cf47fe6fdd3c3588d9f00d1773170911 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Tue, 21 May 2019 14:49:23 +0200 Subject: [PATCH] FIX: extrafield list search: SQL error when field is multiselect --- htdocs/core/tpl/extrafields_list_search_sql.tpl.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php index 8492160c185..bdaf963b4f5 100644 --- a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php @@ -27,6 +27,7 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_ if (in_array($typ, array('int','double','real'))) $mode_search=1; // Search on a numeric if (in_array($typ, array('sellist','link')) && $crit != '0' && $crit != '-1') $mode_search=2; // Search on a foreign key int if (in_array($typ, array('chkbxlst','checkbox'))) $mode_search=4; // Search on a multiselect field with sql type = text + if (is_array($crit)) $crit = implode(' ', $crit); // natural_search() expects a string $sql .= natural_search('ef.'.$tmpkey, $crit, $mode_search); }