From b89ebd255c22822aac4b4a7416dd93938c2de278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mudr=C3=A1k?= Date: Wed, 29 Apr 2020 15:34:02 +0200 Subject: [PATCH] MDL-68558 admin: Allow to go back to plugins check page on failed deps Once the admin reaches the Plugin dependencies check with a failed plugin dependency, the "Continue" button should take him/her to the previous page where the dependency can be sorted out, or the plugin installation cancelled. Also the "Cancel this installation" should work on this page, too. None of this was happening correctly because the page with failed dependencies is loaded with "confirmplugincheck" set to 1 as a result of confirming the previous step. We must explicitly override it back to 0 to navigate the user back to the previous step. --- admin/index.php | 6 ++++-- admin/renderer.php | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/admin/index.php b/admin/index.php index e2b8c5d6eb6..b977381f01f 100644 --- a/admin/index.php +++ b/admin/index.php @@ -509,7 +509,8 @@ if (!$cache and $version > $CFG->version) { // upgrade // Always verify plugin dependencies! $failed = array(); if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) { - echo $output->unsatisfied_dependencies_page($version, $failed, $PAGE->url); + echo $output->unsatisfied_dependencies_page($version, $failed, new moodle_url($PAGE->url, + array('confirmplugincheck' => 0))); die(); } unset($failed); @@ -701,7 +702,8 @@ if (!$cache and moodle_needs_upgrading()) { $failed = array(); if (!$pluginman->all_plugins_ok($version, $failed)) { $output = $PAGE->get_renderer('core', 'admin'); - echo $output->unsatisfied_dependencies_page($version, $failed, $PAGE->url); + echo $output->unsatisfied_dependencies_page($version, $failed, new moodle_url($PAGE->url, + array('confirmplugincheck' => 0))); die(); } unset($failed); diff --git a/admin/renderer.php b/admin/renderer.php index ca2e78d67d2..82f03d3d737 100644 --- a/admin/renderer.php +++ b/admin/renderer.php @@ -1098,7 +1098,7 @@ class core_admin_renderer extends plugin_renderer_base { if (!empty($installabortable[$plugin->component])) { $status .= $this->output->single_button( - new moodle_url($this->page->url, array('abortinstall' => $plugin->component)), + new moodle_url($this->page->url, array('abortinstall' => $plugin->component, 'confirmplugincheck' => 0)), get_string('cancelinstallone', 'core_plugin'), 'post', array('class' => 'actionbutton cancelinstallone d-block mt-1') @@ -1194,7 +1194,7 @@ class core_admin_renderer extends plugin_renderer_base { if ($installabortable) { $out .= $this->output->single_button( - new moodle_url($this->page->url, array('abortinstallx' => 1)), + new moodle_url($this->page->url, array('abortinstallx' => 1, 'confirmplugincheck' => 0)), get_string('cancelinstallall', 'core_plugin', count($installabortable)), 'post', array('class' => 'singlebutton cancelinstallall mr-1')