diff --git a/admin/tool/log/stores.php b/admin/tool/log/stores.php index 4710362b7fb..997f3d43a83 100644 --- a/admin/tool/log/stores.php +++ b/admin/tool/log/stores.php @@ -50,6 +50,7 @@ switch ($action) { case 'disable': unset($enabled[$enrol]); set_config('enabled_stores', implode(',', array_keys($enabled)), 'tool_log'); + add_to_config_log('tool_logstore_visibility', '1', '0', $enrol); break; case 'enable': @@ -59,6 +60,7 @@ switch ($action) { $enabled = array_keys($enabled); $enabled[] = $enrol; set_config('enabled_stores', implode(',', $enabled), 'tool_log'); + add_to_config_log('tool_logstore_visibility', '0', '1', $enrol); break; case 'up': diff --git a/admin/tool/log/tests/behat/logstore_store_visibility_change.feature b/admin/tool/log/tests/behat/logstore_store_visibility_change.feature new file mode 100644 index 00000000000..137023e5601 --- /dev/null +++ b/admin/tool/log/tests/behat/logstore_store_visibility_change.feature @@ -0,0 +1,19 @@ +@tool_log @report @report_configlog +Feature: In a report, admin can see logstore visibility changes + + # Change log stores visibility so the report contains known data. + Background: + Given I log in as "admin" + And the following config values are set as admin: + | enabled_stores | logstore_standard | tool_log | + + @javascript + Scenario: Display configuration changes report + When I navigate to "Plugins > Logging > Manage log stores" in site administration + And I click on "Disable" "icon" in the "Standard log" "table_row" + And I click on "Enable" "icon" in the "External database log" "table_row" + And I navigate to "Reports > Config changes" in site administration + Then the following should exist in the "report-configlog-report-table" table: + | User | Plugin | Setting | New value | Original value | + | Admin User | logstore_standard | tool_logstore_visibility | 0 | 1 | + | Admin User | logstore_database | tool_logstore_visibility | 1 | 0 |