From 057e1a1f6d5eca18a02d46b4884e3948bf9eeb70 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Mon, 31 Oct 2016 22:49:39 +0800 Subject: [PATCH] MDL-56576 admin: Cannot edit blocks on search page Admin search page was processing the blocks delete request before the blocks could process it. Added a hidden field to the search results form so it can be sure the form submission was for saving admin settings. --- admin/search.php | 2 +- admin/templates/settings_search_results.mustache | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/admin/search.php b/admin/search.php index 2979b4d74df..7dd8e2c0a77 100644 --- a/admin/search.php +++ b/admin/search.php @@ -19,7 +19,7 @@ $errormsg = ''; $focus = ''; // now we'll deal with the case that the admin has submitted the form with changed settings -if ($data = data_submitted() and confirm_sesskey()) { +if ($data = data_submitted() and confirm_sesskey() and isset($data->action) and $data->action == 'save-settings') { require_capability('moodle/site:config', $context); if (admin_write_settings($data)) { redirect($PAGE->url, get_string('changessaved'), null, \core\output\notification::NOTIFY_SUCCESS); diff --git a/admin/templates/settings_search_results.mustache b/admin/templates/settings_search_results.mustache index c6f7bbb3bb5..78b62053374 100644 --- a/admin/templates/settings_search_results.mustache +++ b/admin/templates/settings_search_results.mustache @@ -37,6 +37,7 @@
+