Merge pull request #11231 from ATM-Marc/FIX_8.0_extrafields_search

FIX: extrafield list search: SQL error when field is multiselect
This commit is contained in:
Laurent Destailleur 2019-05-21 22:38:14 +02:00 committed by GitHub
commit 16f7d96ed1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}