From 9d4f46e4b60c3dd2028a38b20663bdf29623b41b Mon Sep 17 00:00:00 2001 From: Michael Hawkins Date: Fri, 15 Oct 2021 17:46:38 +0800 Subject: [PATCH] MDL-72781 tool_usertours: Disable activity completion user tours --- admin/tool/usertours/classes/manager.php | 10 ++++++---- admin/tool/usertours/db/upgrade.php | 21 +++++++-------------- admin/tool/usertours/version.php | 2 +- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/admin/tool/usertours/classes/manager.php b/admin/tool/usertours/classes/manager.php index cc0eb1b4648..9b26860ee4f 100644 --- a/admin/tool/usertours/classes/manager.php +++ b/admin/tool/usertours/classes/manager.php @@ -862,10 +862,6 @@ class manager { // the format filename => version. The version value needs to // be increased if the tour has been updated. $shippedtours = [ - '311_activity_information_activity_page_student.json' => 2, - '311_activity_information_activity_page_teacher.json' => 2, - '311_activity_information_course_page_student.json' => 2, - '311_activity_information_course_page_teacher.json' => 2 ]; // These are tours that we used to ship but don't ship any longer. @@ -878,6 +874,12 @@ class manager { // Formerly included in Moodle 3.6.0. '36_dashboard.json' => 3, '36_messaging.json' => 3, + + // Formerly included in Moodle 3.11.0. + '311_activity_information_activity_page_student.json' => 2, + '311_activity_information_activity_page_teacher.json' => 2, + '311_activity_information_course_page_student.json' => 2, + '311_activity_information_course_page_teacher.json' => 2, ]; $existingtourrecords = $DB->get_recordset('tool_usertours_tours'); diff --git a/admin/tool/usertours/db/upgrade.php b/admin/tool/usertours/db/upgrade.php index b1873c8cd7e..b299b85f1be 100644 --- a/admin/tool/usertours/db/upgrade.php +++ b/admin/tool/usertours/db/upgrade.php @@ -47,13 +47,6 @@ function xmldb_tool_usertours_upgrade($oldversion) { // Automatically generated Moodle v3.8.0 release upgrade line. // Put any upgrade step following this. - if ($oldversion < 2020061501) { - // Updating shipped tours will fix broken sortorder records in existing tours. - manager::update_shipped_tours(); - - upgrade_plugin_savepoint(true, 2020061501, 'tool', 'usertours'); - } - // Automatically generated Moodle v3.9.0 release upgrade line. // Put any upgrade step following this. @@ -78,13 +71,6 @@ function xmldb_tool_usertours_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2021052501, 'tool', 'usertours'); } - if ($oldversion < 2021052508) { - // Updating shipped tours. - manager::update_shipped_tours(); - - upgrade_plugin_savepoint(true, 2021052508, 'tool', 'usertours'); - } - if ($oldversion < 2021092300) { // Define field endtourlabel to be added to tool_usertours_tours. $table = new xmldb_table('tool_usertours_tours'); @@ -128,5 +114,12 @@ function xmldb_tool_usertours_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2021101300, 'tool', 'usertours'); } + if ($oldversion < 2021101301) { + // Update shipped tours. + manager::update_shipped_tours(); + + upgrade_plugin_savepoint(true, 2021101301, 'tool', 'usertours'); + } + return true; } diff --git a/admin/tool/usertours/version.php b/admin/tool/usertours/version.php index 6c49cf6373e..05c0e8108c4 100644 --- a/admin/tool/usertours/version.php +++ b/admin/tool/usertours/version.php @@ -24,6 +24,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2021101300; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2021101301; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2021052500; // Requires this Moodle version. $plugin->component = 'tool_usertours'; // Full name of the plugin (used for diagnostics).