diff --git a/admin/search.php b/admin/search.php index 82c5969992b..3dc565eca84 100644 --- a/admin/search.php +++ b/admin/search.php @@ -20,13 +20,15 @@ $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 (admin_write_settings($data)) { - $statusmsg = get_string('changessaved'); + redirect($PAGE->url, get_string('changessaved'), null, \core\output\notification::NOTIFY_SUCCESS); } if (!empty($adminroot->errors)) { $errormsg = get_string('errorwithsettings', 'admin'); $firsterror = reset($adminroot->errors); $focus = $firsterror->id; + } else { + redirect($PAGE->url); } } diff --git a/admin/settings.php b/admin/settings.php index e8f57825e76..76584b346e4 100644 --- a/admin/settings.php +++ b/admin/settings.php @@ -36,7 +36,7 @@ $errormsg = ''; if ($data = data_submitted() and confirm_sesskey()) { if (admin_write_settings($data)) { - $statusmsg = get_string('changessaved'); + redirect($PAGE->url, get_string('changessaved'), null, \core\output\notification::NOTIFY_SUCCESS); } if (empty($adminroot->errors)) { @@ -44,6 +44,7 @@ if ($data = data_submitted() and confirm_sesskey()) { case 'site': redirect("$CFG->wwwroot/"); case 'admin': redirect("$CFG->wwwroot/$CFG->admin/"); } + redirect($PAGE->url); } else { $errormsg = get_string('errorwithsettings', 'admin'); $firsterror = reset($adminroot->errors); @@ -72,7 +73,7 @@ if (empty($SITE->fullname)) { // --------------------------------------------------------------------------------------------------------------- - echo '