Commit a26cfe71 authored by Sara Arjona's avatar Sara Arjona
Browse files

MDL-65809 upgrade: clean < 3.5.0 upgrade steps

This just deletes all the upgrade steps previous to 3.5.0. Some
small adjustments, like tweaking globals can also be applied
when needed.

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

Previous commits have removed/deprecated all the upgradelib functions
not used anymore in codebase. Deletion has been documented in corresponding
upgrade.txt files:

- upgrade_fix_block_instance_configuration()
- upgrade_theme_is_from_family(), upgrade_find_theme_location()
and linkcoursesectionsupgradescriptwasrun setting
- upgrade_block_positions
- upgrade_fix_config_auth_plugin_names()
 and upgrade_fix_config_auth_plugin_defaults()
- format_xxx_upgrade_remove_numsections(), format_xxx_upgrade_hide_extra_sections()
and format_xxx_upgrade_add_empty_sections()
- filter_mathjaxloader_upgrade_cdn_cloudflare()
and filter_mathjaxloader_upgrade_mathjaxconfig_equal()
- get_assignments_with_rescaled_null_grades()

These have been kept because continue being used by restore:

- \core\task\refresh_mod_calendar_events_task
parent d2b7f6f5
......@@ -29,12 +29,6 @@ defined('MOODLE_INTERNAL') || die();
function xmldb_tool_customlang_upgrade($oldversion) {
global $CFG;
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -33,12 +33,6 @@ defined('MOODLE_INTERNAL') || die();
function xmldb_tool_log_upgrade($oldversion) {
global $CFG;
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -27,12 +27,6 @@ defined('MOODLE_INTERNAL') || die();
function xmldb_logstore_database_upgrade($oldversion) {
global $CFG;
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -27,12 +27,6 @@ defined('MOODLE_INTERNAL') || die();
function xmldb_logstore_standard_upgrade($oldversion) {
global $CFG;
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -33,29 +33,6 @@ defined('MOODLE_INTERNAL') || die();
function xmldb_tool_monitor_upgrade($oldversion) {
global $CFG, $DB;
if ($oldversion < 2017021300) {
// Delete "orphaned" subscriptions.
$sql = "SELECT DISTINCT s.courseid
FROM {tool_monitor_subscriptions} s
LEFT OUTER JOIN {course} c ON c.id = s.courseid
WHERE s.courseid <> 0 and c.id IS NULL";
$deletedcourses = $DB->get_field_sql($sql);
if ($deletedcourses) {
list($sql, $params) = $DB->get_in_or_equal($deletedcourses);
$DB->execute("DELETE FROM {tool_monitor_subscriptions} WHERE courseid " . $sql, $params);
}
// Monitor savepoint reached.
upgrade_plugin_savepoint(true, 2017021300, 'tool', 'monitor');
}
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -35,12 +35,6 @@ use tool_usertours\manager;
function xmldb_tool_usertours_upgrade($oldversion) {
global $CFG, $DB;
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -32,12 +32,6 @@ defined('MOODLE_INTERNAL') || die();
function xmldb_auth_cas_upgrade($oldversion) {
global $CFG;
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -32,12 +32,6 @@ defined('MOODLE_INTERNAL') || die();
function xmldb_auth_db_upgrade($oldversion) {
global $CFG, $DB;
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -32,12 +32,6 @@ defined('MOODLE_INTERNAL') || die();
function xmldb_auth_email_upgrade($oldversion) {
global $CFG, $DB;
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -32,30 +32,6 @@ defined('MOODLE_INTERNAL') || die();
function xmldb_auth_ldap_upgrade($oldversion) {
global $CFG;
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2017080100) {
// The "auth_ldap/coursecreators" setting was replaced with "auth_ldap/coursecreatorcontext" (created
// dynamically from system-assignable roles) - so migrate any existing value to the first new slot.
if ($ldapcontext = get_config('auth_ldap', 'creators')) {
// Get info about the role that the old coursecreators setting would apply.
$creatorrole = get_archetype_roles('coursecreator');
$creatorrole = array_shift($creatorrole); // We can only use one, let's use the first.
// Create new setting.
set_config($creatorrole->shortname . 'context', $ldapcontext, 'auth_ldap');
// Delete old setting.
set_config('creators', null, 'auth_ldap');
upgrade_plugin_savepoint(true, 2017080100, 'auth', 'ldap');
}
}
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -32,12 +32,6 @@ defined('MOODLE_INTERNAL') || die();
function xmldb_auth_manual_upgrade($oldversion) {
global $CFG;
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -32,12 +32,6 @@ defined('MOODLE_INTERNAL') || die();
function xmldb_auth_mnet_upgrade($oldversion) {
global $CFG;
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -32,12 +32,6 @@ defined('MOODLE_INTERNAL') || die();
function xmldb_auth_none_upgrade($oldversion) {
global $CFG, $DB;
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -35,12 +35,6 @@ function xmldb_auth_oauth2_upgrade($oldversion) {
$dbman = $DB->get_manager();
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -32,12 +32,6 @@ defined('MOODLE_INTERNAL') || die();
function xmldb_auth_shibboleth_upgrade($oldversion) {
global $CFG, $DB;
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -45,12 +45,6 @@
function xmldb_block_badges_upgrade($oldversion, $block) {
global $CFG;
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -45,12 +45,6 @@
function xmldb_block_calendar_month_upgrade($oldversion, $block) {
global $CFG;
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -45,12 +45,6 @@
function xmldb_block_calendar_upcoming_upgrade($oldversion, $block) {
global $CFG;
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -48,12 +48,6 @@ defined('MOODLE_INTERNAL') || die();
function xmldb_block_completionstatus_upgrade($oldversion, $block) {
global $CFG;
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
......@@ -48,12 +48,6 @@ defined('MOODLE_INTERNAL') || die();
function xmldb_block_course_summary_upgrade($oldversion, $block) {
global $CFG;
// Automatically generated Moodle v3.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.4.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment