diff --git a/src/ORM/Filters/SearchFilterable.php b/src/ORM/Filters/SearchFilterable.php index c736eee5b0a..ff145039b6e 100644 --- a/src/ORM/Filters/SearchFilterable.php +++ b/src/ORM/Filters/SearchFilterable.php @@ -40,7 +40,18 @@ protected function createSearchFilter($filter, $value) $filterServiceName = "DataListFilter.{$secondArg}"; } } + if (is_array($value)) { + foreach ($value as $key => $val) { + if ($val === '' || $val === 'null') { + $value[] = null; + } + } + } else { + if ($value === '' || $value === 'null') { + $value = ['', null]; + } + } // Build instance return Injector::inst()->create($filterServiceName, $fieldName, $value, $modifiers); }