Skip to content
Snippets Groups Projects
Commit 2f3ecc59 authored by JediKev's avatar JediKev
Browse files

oops: Selection Search Bug

This addresses an issue introduced with 4124 where searching for a Selection
Field with the criteria "does not have a value" throws an `implode()`
warning.
parent 4a4d5452
Branches
Tags
No related merge requests found
......@@ -1822,7 +1822,9 @@ class SelectionField extends FormField {
function getSearchQ($method, $value, $name=false) {
$name = $name ?: $this->get('name');
$val = '"?'.implode('("|,|$)|"?', array_keys($value)).'("|,|$)';
$val = $value;
if ($value && is_array($value))
$val = '"?'.implode('("|,|$)|"?', array_keys($value)).'("|,|$)';
switch ($method) {
case '!includes':
return Q::not(array("{$name}__regex" => $val));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment