diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php
index 6d654d8a300805b084bc22389a537f870654cbef..9e5ece6717585e697b13df71265dfec22bcaff05 100644
--- a/include/class.dynamic_forms.php
+++ b/include/class.dynamic_forms.php
@@ -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));