Skip to content

Commit

Permalink
Merge branch 'MDL-52777-master-bug' of github.com:andrewnicols/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Oct 20, 2016
2 parents 664b637 + c4d5fb5 commit 1b07e80
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions admin/tool/usertours/classes/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,8 @@ public static function get_current_tour($reset = false) {
public static function get_matching_tours(\moodle_url $pageurl) {
global $DB, $PAGE;

// Do not show tours whilst upgrades are pending.
if (moodle_needs_upgrading()) {
if (self::tour_upgrade_pending()) {
// Do not show tours whilst upgrades are pending agains the plugin.
return null;
}

Expand All @@ -587,6 +587,21 @@ public static function get_matching_tours(\moodle_url $pageurl) {
return null;
}

/**
* Determine whether the tour plugin is pending an upgrade.
*
* @return bool
*/
public static function tour_upgrade_pending() {
$plugin = new \stdClass();
include(dirname(__DIR__) . '/version.php');

$manager = \core_plugin_manager::instance();
$plugininfo = $manager->get_plugin_info('tool_usertours');

return ($plugin->version != $plugininfo->versiondb);
}

/**
* Import the provided tour JSON.
*
Expand Down

0 comments on commit 1b07e80

Please sign in to comment.