MDL-70142 admin: preserve selected cache definitions in the form.
By not redirecting when we are already on the purge caches page we can preserve the submitted form data, allowing users to easily repeat the previous action.
This commit is contained in:
@@ -52,8 +52,14 @@ if ($data = $form->get_data()) {
|
||||
$message = get_string('purgecachesfinished', 'admin');
|
||||
}
|
||||
|
||||
// Redirect and/or show notification message confirming cache(s) were purged.
|
||||
if (isset($message)) {
|
||||
redirect($returnurl, $message);
|
||||
if (!$PAGE->url->compare($returnurl, URL_MATCH_BASE)) {
|
||||
redirect($returnurl, $message);
|
||||
}
|
||||
|
||||
// We are already on the purge caches page, add the notification.
|
||||
\core\notification::add($message, \core\output\notification::NOTIFY_INFO);
|
||||
}
|
||||
|
||||
// Otherwise, show a form to actually purge the caches.
|
||||
|
||||
Reference in New Issue
Block a user