From 5d206a0015832a5cb9b4c915080c89d4a6447cd4 Mon Sep 17 00:00:00 2001 From: David Bogner Date: Sat, 25 May 2024 06:27:59 +0200 Subject: [PATCH] Fix search mode rendering for select fields --- filter/filter_form.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/filter/filter_form.php b/filter/filter_form.php index ebd86aaf..38152dab 100644 --- a/filter/filter_form.php +++ b/filter/filter_form.php @@ -181,6 +181,10 @@ public function custom_search_definition($customsearch, $fields, $fieldoptions, $operatoroptions); $mform->setDefault('searchoperator' . $count, $operator); // Field search elements. + // For select options $value is an arry, we have to convert it to string, function param only accepts strings. + if (is_array($value)) { + $value = json_encode($value); + } list($elems, $separators) = $fields[$fieldid]->renderer()->render_search_mode( $mform, $count, $value);