Skip to content

Commit

Permalink
MDL-70142 admin: preserve selected cache definitions in the form.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
paulholden committed Mar 26, 2021
1 parent c54de9b commit 8576829
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion admin/purgecaches.php
Expand Up @@ -52,8 +52,14 @@
$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.
Expand Down

0 comments on commit 8576829

Please sign in to comment.