From 634d1a3dcdb2efdb249d333f2827660b2c674301 Mon Sep 17 00:00:00 2001 From: oliviervalentin Date: Wed, 27 Sep 2023 14:42:56 +0200 Subject: [PATCH] MDL-79510 report_configlog : implement filtering by plugin. --- .../reportbuilder/local/entities/config_change.php | 10 ++++++++++ .../local/systemreports/config_changes.php | 1 + report/configlog/tests/behat/view_report.feature | 1 + 3 files changed, 12 insertions(+) diff --git a/report/configlog/classes/reportbuilder/local/entities/config_change.php b/report/configlog/classes/reportbuilder/local/entities/config_change.php index 53695e749672c..5d3665c131f32 100644 --- a/report/configlog/classes/reportbuilder/local/entities/config_change.php +++ b/report/configlog/classes/reportbuilder/local/entities/config_change.php @@ -172,6 +172,16 @@ protected function get_all_filters(): array { date::DATE_CURRENT, ]); + // Plugin filter. + $filters[] = (new filter( + text::class, + 'plugin', + new lang_string('plugin', 'report_configlog'), + $this->get_entity_name(), + "COALESCE({$tablealias}.plugin, 'core')" + )) + ->add_joins($this->get_joins()); + // Setting filter. $filters[] = (new filter( text::class, diff --git a/report/configlog/classes/reportbuilder/local/systemreports/config_changes.php b/report/configlog/classes/reportbuilder/local/systemreports/config_changes.php index 4f4afb6e12c46..18143c33cec56 100644 --- a/report/configlog/classes/reportbuilder/local/systemreports/config_changes.php +++ b/report/configlog/classes/reportbuilder/local/systemreports/config_changes.php @@ -103,6 +103,7 @@ protected function add_columns(): void { */ protected function add_filters(): void { $filters = [ + 'config_change:plugin', 'config_change:setting', 'config_change:value', 'config_change:oldvalue', diff --git a/report/configlog/tests/behat/view_report.feature b/report/configlog/tests/behat/view_report.feature index 0df50d4af7c5e..0be890c5d9b76 100644 --- a/report/configlog/tests/behat/view_report.feature +++ b/report/configlog/tests/behat/view_report.feature @@ -37,6 +37,7 @@ Feature: In a report, admin can see configuration changes And I should not see "" in the "reportbuilder-table" "table" Examples: | field | search | plugin | setting | value | excluded | + | Plugin | folder | folder | maxsizetodownload | 2048 | quiz | | Setting | initialnumfeedbacks | quiz | initialnumfeedbacks | 5 | maxsizetodownload | | Setting | maxsizetodownload | folder | maxsizetodownload | 2048 | initialnumfeedbacks | | New value | Perth | core | defaultcity | Perth | maxsizetodownload |