From 429508a7b4285fad61c7db4db7339ff43bfa4377 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Tue, 1 Nov 2022 14:05:39 +0000 Subject: [PATCH] MDL-76142 cohort: cross DB support for description filter. Specifically avoids Oracle exception ORA-00932. --- cohort/classes/reportbuilder/local/entities/cohort.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cohort/classes/reportbuilder/local/entities/cohort.php b/cohort/classes/reportbuilder/local/entities/cohort.php index e7c54b150c3..9b139333097 100644 --- a/cohort/classes/reportbuilder/local/entities/cohort.php +++ b/cohort/classes/reportbuilder/local/entities/cohort.php @@ -236,6 +236,8 @@ class cohort extends base { * @return filter[] */ protected function get_all_filters(): array { + global $DB; + $tablealias = $this->get_table_alias('cohort'); // Context filter. @@ -302,7 +304,7 @@ class cohort extends base { 'description', new lang_string('description'), $this->get_entity_name(), - "{$tablealias}.description" + $DB->sql_cast_to_char("{$tablealias}.description") )) ->add_joins($this->get_joins()); -- 2.43.0