From f246d308312d8bd2de6dcac5158dbb02b6a7a88c Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Fri, 13 Mar 2020 13:57:43 +0000 Subject: [PATCH] MDL-52319 upgrade: Also run environment checks if plugins need upgrades Also perform the environment checks if a plugin triggers the upgrade. Core upgrade and CLI upgrade was doing this already. --- admin/index.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/admin/index.php b/admin/index.php index c34a437d9c6..b559aa16e33 100644 --- a/admin/index.php +++ b/admin/index.php @@ -533,7 +533,10 @@ if (!$cache and $branch <> $CFG->branch) { // Update the branch if (!$cache and moodle_needs_upgrading()) { - $PAGE->set_url(new moodle_url($PAGE->url, array('confirmplugincheck' => $confirmplugins))); + $PAGE->set_url(new moodle_url($PAGE->url, array( + 'confirmrelease' => $confirmrelease, + 'confirmplugincheck' => $confirmplugins, + ))); check_upgrade_key($upgradekeyhash); @@ -543,7 +546,21 @@ if (!$cache and moodle_needs_upgrading()) { $pluginman = core_plugin_manager::instance(); $output = $PAGE->get_renderer('core', 'admin'); - if (!$confirmplugins) { + if (empty($confirmrelease)) { + require_once($CFG->libdir . '/environmentlib.php'); + + list($envstatus, $environmentresults) = check_moodle_environment($release, ENV_SELECT_RELEASE); + $strcurrentrelease = get_string('currentrelease'); + + $PAGE->navbar->add($strcurrentrelease); + $PAGE->set_title($strcurrentrelease); + $PAGE->set_heading($strcurrentrelease); + $PAGE->set_cacheable(false); + + echo $output->upgrade_environment_page($release, $envstatus, $environmentresults); + die(); + + } else if (!$confirmplugins) { $strplugincheck = get_string('plugincheck'); $PAGE->navbar->add($strplugincheck);