Compare commits

...

2 Commits

Author SHA1 Message Date
Sunny Side Up
dd9fba5851
Merge 5c9c5519f3 into ebbd6427b2 2024-10-12 05:30:37 +13:00
Sunny Side Up
5c9c5519f3
FIX: equate empty string to null for more intuitive results 2024-09-08 12:21:22 +12:00

View File

@ -40,7 +40,18 @@ trait SearchFilterable
$filterServiceName = "DataListFilter.{$secondArg}"; $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 // Build instance
return Injector::inst()->create($filterServiceName, $fieldName, $value, $modifiers); return Injector::inst()->create($filterServiceName, $fieldName, $value, $modifiers);
} }