Skip to content

Commit

Permalink
MDL-59159 upgrade: clean < 3.1.0 upgrade steps
Browse files Browse the repository at this point in the history
LTS (3.5) requires previous LTS (3.1)

This just deletes all the upgrade steps previous to 3.1.0. Some
small adjustments, like adding missing MOODLE_INTERNAL or tweaking
globals can also be applied when needed.

Also includes an upgrade step to prevent upgrading from any
version < 2016052300 (v3.1.0) as anti-cheating measure.

Next commit will get rid of/deprecate all the upgradelib functions
not used anymore in codebase.
  • Loading branch information
stronk7 committed Dec 4, 2017
1 parent 4111611 commit e4eba4c
Show file tree
Hide file tree
Showing 99 changed files with 8 additions and 1,593 deletions.
3 changes: 0 additions & 3 deletions admin/tool/customlang/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
function xmldb_tool_customlang_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions admin/tool/log/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
function xmldb_tool_log_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions admin/tool/log/store/database/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
function xmldb_logstore_database_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions admin/tool/log/store/standard/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
function xmldb_logstore_standard_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions admin/tool/monitor/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ function xmldb_tool_monitor_upgrade($oldversion) {

$dbman = $DB->get_manager();

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

if ($oldversion < 2016052305) {

// Define field inactivedate to be added to tool_monitor_subscriptions.
Expand Down
3 changes: 0 additions & 3 deletions auth/cas/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
function xmldb_auth_cas_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions auth/ldap/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
function xmldb_auth_ldap_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions auth/manual/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
function xmldb_auth_manual_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions auth/mnet/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
function xmldb_auth_mnet_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2017020700) {
Expand Down
3 changes: 0 additions & 3 deletions blocks/badges/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
function xmldb_block_badges_upgrade($oldversion, $block) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions blocks/calendar_month/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
function xmldb_block_calendar_month_upgrade($oldversion, $block) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions blocks/calendar_upcoming/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
function xmldb_block_calendar_upcoming_upgrade($oldversion, $block) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions blocks/community/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
function xmldb_block_community_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions blocks/completionstatus/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@
function xmldb_block_completionstatus_upgrade($oldversion, $block) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions blocks/course_summary/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@
function xmldb_block_course_summary_upgrade($oldversion, $block) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions blocks/html/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
function xmldb_block_html_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions blocks/navigation/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@
function xmldb_block_navigation_upgrade($oldversion, $block) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions blocks/quiz_results/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
function xmldb_block_quiz_results_upgrade($oldversion, $block) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions blocks/recent_activity/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@
function xmldb_block_recent_activity_upgrade($oldversion, $block) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions blocks/rss_client/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
function xmldb_block_rss_client_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions blocks/section_links/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
function xmldb_block_section_links_upgrade($oldversion, $block) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions blocks/selfcompletion/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@
function xmldb_block_selfcompletion_upgrade($oldversion, $block) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions blocks/settings/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@
function xmldb_block_settings_upgrade($oldversion, $block) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions enrol/database/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
function xmldb_enrol_database_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions enrol/flatfile/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
function xmldb_enrol_flatfile_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions enrol/guest/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
function xmldb_enrol_guest_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions enrol/imsenterprise/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
function xmldb_enrol_imsenterprise_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions enrol/manual/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
function xmldb_enrol_manual_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions enrol/mnet/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
function xmldb_enrol_mnet_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions enrol/paypal/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
function xmldb_enrol_paypal_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions enrol/self/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
function xmldb_enrol_self_upgrade($oldversion) {
global $CFG, $DB;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

if ($oldversion < 2016052301) {
// Get roles with manager archetype.
$managerroles = get_archetype_roles('manager');
Expand Down
23 changes: 3 additions & 20 deletions filter/mathjaxloader/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,6 @@ function xmldb_filter_mathjaxloader_upgrade($oldversion) {

require_once($CFG->dirroot . '/filter/mathjaxloader/db/upgradelib.php');

if ($oldversion < 2016032200) {

$httpurl = get_config('filter_mathjaxloader', 'httpurl');
// Don't change the config if it has been manually changed to something besides the default setting value.
if ($httpurl === "http://cdn.mathjax.org/mathjax/2.5-latest/MathJax.js") {
set_config('httpurl', 'http://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js', 'filter_mathjaxloader');
}

$httpsurl = get_config('filter_mathjaxloader', 'httpsurl');
// Don't change the config if it has been manually changed to something besides the default setting value.
if ($httpsurl === "https://cdn.mathjax.org/mathjax/2.5-latest/MathJax.js") {
set_config('httpsurl', 'https://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js', 'filter_mathjaxloader');
}

upgrade_plugin_savepoint(true, 2016032200, 'filter', 'mathjaxloader');
}

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

if ($oldversion < 2016080200) {
// We are consolodating the two settings for http and https url into only the https
// setting. Since it is preferably to always load the secure resource.
Expand All @@ -78,8 +58,10 @@ function xmldb_filter_mathjaxloader_upgrade($oldversion) {
}
upgrade_plugin_savepoint(true, 2016102500, 'filter', 'mathjaxloader');
}

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
//
if ($oldversion < 2017040300) {

$httpsurl = get_config('filter_mathjaxloader', 'httpsurl');
Expand All @@ -97,6 +79,7 @@ function xmldb_filter_mathjaxloader_upgrade($oldversion) {

upgrade_plugin_savepoint(true, 2017040300, 'filter', 'mathjaxloader');
}

if ($oldversion < 2017042602) {

$httpsurl = get_config('filter_mathjaxloader', 'httpsurl');
Expand Down
3 changes: 0 additions & 3 deletions filter/mediaplugin/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
function xmldb_filter_mediaplugin_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
3 changes: 0 additions & 3 deletions filter/tex/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
function xmldb_filter_tex_upgrade($oldversion) {
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
12 changes: 0 additions & 12 deletions grade/grading/form/guide/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,6 @@
function xmldb_gradingform_guide_upgrade($oldversion) {
global $DB;

if ($oldversion < 2016051100) {
// Clean up empty string or null marking guide comments.
$sql = $DB->sql_isempty('gradingform_guide_comments', 'description', true, true);
$sql .= " OR description IS NULL ";
$DB->delete_records_select('gradingform_guide_comments', $sql);
// Main savepoint reached.
upgrade_plugin_savepoint(true, 2016051100, 'gradingform', 'guide');
}

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
Loading

0 comments on commit e4eba4c

Please sign in to comment.