mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX: equate empty string to null for more intuitive results
This commit is contained in:
parent
b13b657de5
commit
5c9c5519f3
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user