Compare commits

...

2 Commits

Author SHA1 Message Date
Sunny Side Up
05673e9f36
Merge 5c9c5519f3 into 165f72fd22 2024-10-22 12:56:53 +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}";
}
}
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);
}