Skip to content

Commit

Permalink
MDL-68558 admin: Allow to go back to plugins check page on failed deps
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mudrd8mz committed Jul 23, 2020
1 parent 741d6dd commit 9d17179
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,8 @@
// Always verify plugin dependencies!
$failed = array();
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed, $CFG->branch)) {
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);
Expand Down Expand Up @@ -701,7 +702,8 @@
$failed = array();
if (!$pluginman->all_plugins_ok($version, $failed, $CFG->branch)) {
$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);
Expand Down
4 changes: 2 additions & 2 deletions admin/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ public function plugins_check_table(core_plugin_manager $pluginman, $version, ar

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')
Expand Down Expand Up @@ -1209,7 +1209,7 @@ public function plugins_check_table(core_plugin_manager $pluginman, $version, ar

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')
Expand Down

0 comments on commit 9d17179

Please sign in to comment.