diff --git a/admin/index.php b/admin/index.php index 203497d079a..7ea72af6a92 100644 --- a/admin/index.php +++ b/admin/index.php @@ -382,9 +382,6 @@ if (!$cache and moodle_needs_upgrading()) { if (!$PAGE->headerprinted) { // means core upgrade or installation was not already done - /** @var core_admin_renderer $output */ - $output = $PAGE->get_renderer('core', 'admin'); - if (!$confirmplugins) { $strplugincheck = get_string('plugincheck'); @@ -402,6 +399,9 @@ if (!$cache and moodle_needs_upgrading()) { redirect($PAGE->url); } + /** @var core_admin_renderer $output */ + $output = $PAGE->get_renderer('core', 'admin'); + $deployer = \core\update\deployer::instance(); if ($deployer->enabled()) { $deployer->initialize($PAGE->url, $PAGE->url); @@ -425,6 +425,8 @@ if (!$cache and moodle_needs_upgrading()) { // Make sure plugin dependencies are always checked. $failed = array(); if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) { + /** @var core_admin_renderer $output */ + $output = $PAGE->get_renderer('core', 'admin'); $reloadurl = new moodle_url('/admin/index.php', array('cache' => 0)); echo $output->unsatisfied_dependencies_page($version, $failed, $reloadurl); die();