Merge pull request #18366 from atm-quentin/FIX_11_postgre_select_filter_extrafield

FIX compatibility postgre sql
This commit is contained in:
Laurent Destailleur 2021-08-11 15:45:04 +02:00 committed by GitHub
commit ab8f78f29a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ if (! empty($extrafieldsobjectkey) && ! empty($search_array_options) && is_array
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) {
$sql .= ' AND (' . $extrafieldsobjectprefix.$tmpkey . ' = "' . $db->escape($crit) . '")';
$sql .= " AND (" . $extrafieldsobjectprefix.$tmpkey . " = '" . $db->escape($crit) . "')";
continue;
}
$sql .= natural_search($extrafieldsobjectprefix.$tmpkey, $crit, $mode_search);