WR #490867 auth_outage Review changes - avoid mutating svgicons before a redirect and update tests for the access key and svgicons changes

This commit is contained in:
Waleed Hassan
2026-07-12 23:45:42 +01:00
parent 1b2979f8e6
commit a6e465b7a3
3 changed files with 22 additions and 12 deletions
+6 -4
View File
@@ -87,10 +87,6 @@ class infopage {
*/
public function output() {
global $PAGE, $CFG, $OUTPUT;
// Enable SVG support here to make sure all SVG files
// used in the current theme are served properly.
$previoussvg = $CFG->svgicons ?? null;
$CFG->svgicons = true;
if (is_null($this->outage)) {
redirect(new moodle_url('/'));
@@ -100,6 +96,12 @@ class infopage {
if (!$this->static && !has_capability('auth/outage:viewinfo', context_system::instance())) {
redirect(new moodle_url('/'));
}
// Enable SVG support here to make sure all SVG files
// used in the current theme are served properly.
$previoussvg = $CFG->svgicons ?? null;
$CFG->svgicons = true;
$PAGE->set_context(context_system::instance());
$PAGE->set_title($this->outage->get_title());
$PAGE->set_heading($this->outage->get_title());