From aa1d100c2d694b979b513de0ede700d9b6fef610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mudr=C3=A1k?= Date: Sat, 10 Oct 2015 00:24:59 +0200 Subject: [PATCH] MDL-49329 admin: Fix checking for available updates This was a regression of my recent improvement of rendering the "Check for updates" button. There is now unified parameter ?fetchupdates=1 that can be used on either admin/index.php or admin/plugins.php, so that we can use a common UI widget for both locations (without the need to pass the URL explicitly). --- admin/index.php | 2 +- admin/plugins.php | 4 ++-- admin/renderer.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/index.php b/admin/index.php index 6c3469fa8fd..3972513871b 100644 --- a/admin/index.php +++ b/admin/index.php @@ -103,7 +103,7 @@ $confirmrelease = optional_param('confirmrelease', 0, PARAM_BOOL); // Core relea $confirmplugins = optional_param('confirmplugincheck', 0, PARAM_BOOL); // Plugins check page confirmed? $showallplugins = optional_param('showallplugins', 0, PARAM_BOOL); // Show all plugins on the plugins check page? $agreelicense = optional_param('agreelicense', 0, PARAM_BOOL); // GPL license confirmed for installation? -$fetchupdates = optional_param('fetchremote', 0, PARAM_BOOL); // Should check for available updates? +$fetchupdates = optional_param('fetchupdates', 0, PARAM_BOOL); // Should check for available updates? $newaddonreq = optional_param('installaddonrequest', null, PARAM_RAW); // Plugin installation requested at moodle.org/plugins. $upgradekeyhash = optional_param('upgradekeyhash', null, PARAM_ALPHANUM); // Hash of provided upgrade key. $installdep = optional_param('installdep', null, PARAM_COMPONENT); // Install given missing dependency (required plugin). diff --git a/admin/plugins.php b/admin/plugins.php index 9c9e2bc6050..39510cc86fc 100644 --- a/admin/plugins.php +++ b/admin/plugins.php @@ -28,7 +28,7 @@ require_once(dirname(dirname(__FILE__)) . '/config.php'); require_once($CFG->libdir . '/adminlib.php'); require_once($CFG->libdir . '/filelib.php'); -$fetchremote = optional_param('fetchremote', false, PARAM_BOOL); // Check for available plugins updates. +$fetchupdates = optional_param('fetchupdates', false, PARAM_BOOL); // Check for available plugins updates. $updatesonly = optional_param('updatesonly', false, PARAM_BOOL); // Show updateable plugins only. $contribonly = optional_param('contribonly', false, PARAM_BOOL); // Show additional plugins only. $uninstall = optional_param('uninstall', '', PARAM_COMPONENT); // Uninstall the plugin. @@ -207,7 +207,7 @@ $output = $PAGE->get_renderer('core', 'admin'); $checker = \core\update\checker::instance(); -if ($fetchremote) { +if ($fetchupdates) { require_sesskey(); $checker->fetch(); redirect($PAGE->url); diff --git a/admin/renderer.php b/admin/renderer.php index 11e0b6d5ac7..14f116d3d26 100644 --- a/admin/renderer.php +++ b/admin/renderer.php @@ -346,7 +346,7 @@ class core_admin_renderer extends plugin_renderer_base { if ($checker->enabled()) { $output .= $this->container_start('checkforupdates'); $output .= $this->single_button( - new moodle_url($reloadurl, array('fetchremote' => 1)), + new moodle_url($reloadurl, array('fetchupdates' => 1)), get_string('checkforupdates', 'core_plugin') ); if ($timefetched = $checker->get_last_timefetched()) {