Merge pull request #9993 from ptibogxiv/patch-90

Fix Invalid argument supplied for foreach()
This commit is contained in:
Laurent Destailleur 2018-11-11 17:29:32 +01:00 committed by GitHub
commit cda88f4df9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,7 @@ if (empty($conf) || ! is_object($conf))
if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey=$object->table_element;
// Loop to complete the sql search criterias from extrafields
if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
if (! empty($extrafieldsobjectkey) && ! empty($search_array_options)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
{
foreach ($search_array_options as $key => $val)
{
@ -32,4 +32,4 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode_search);
}
}
}
}