From 347bb143e7fa154c243372f9d8e9f4d91d09386a Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Wed, 23 Nov 2022 13:41:46 +0000 Subject: [PATCH] MDL-76446 user: correct logic for multiple keyword search. When the keyword participant filter was used with multiple values in conjunction with other participants filters, the boolean logic was effectively: X AND Y OR Z When what we actually wanted was: X AND (Y OR Z) --- user/classes/table/participants_search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/classes/table/participants_search.php b/user/classes/table/participants_search.php index 4d0b967b2eb..24b0f01a423 100644 --- a/user/classes/table/participants_search.php +++ b/user/classes/table/participants_search.php @@ -285,7 +285,7 @@ class participants_search { ] = $this->get_keywords_search_sql($mappings); if (!empty($keywordswhere)) { - $wheres[] = $keywordswhere; + $wheres[] = "({$keywordswhere})"; } if (!empty($keywordsparams)) {