Merge pull request #15964 from FHenry/12.0

extrafeild selllist can be use with string fk
This commit is contained in:
Laurent Destailleur 2021-01-18 18:53:01 +01:00 committed by GitHub
commit 2baeec1537
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,6 +38,7 @@ if (!empty($extrafieldsobjectkey) && !empty($search_array_options) && is_array($
$mode_search = 0;
if (in_array($typ, array('int', 'double', 'real', 'price'))) $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('sellist')) && !is_numeric($crit)) $mode_search = 0;// Search on a foreign key string
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
elseif ($typ === 'select' and is_string($crit) and strpos($crit, ' ') === false) {