diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 8e08d74eae1..21b4ebe58ab 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2566,19 +2566,6 @@ function xmldb_main_upgrade($oldversion) { $dbman->add_field($table, $field); } - // Create adhoc task for upgrading of existing calendar events. - $record = new \stdClass(); - $record->classname = "\\core\\task\\refresh_mod_calendar_events_task"; - $record->component = 'core'; - // Next run time based from nextruntime computation in \core\task\manager::queue_adhoc_task(). - $nextruntime = time() - 1; - $record->nextruntime = $nextruntime; - $DB->insert_record('task_adhoc', $record); - - // This same task is queued again in a later step, but if we already queue it here - // then there is no need to queue it again. We use this flag in the second step. - $refresheventsadhocadded = true; - // Main savepoint reached. upgrade_main_savepoint(true, 2017030700.00); } @@ -2671,21 +2658,6 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2017040402.00); } - if ($oldversion < 2017040403.00) { - // Create adhoc task for upgrading of existing calendar events. - $record = new \stdClass(); - $record->classname = "\\core\\task\\refresh_mod_calendar_events_task"; - $record->component = 'core'; - - // Next run time based from nextruntime computation in \core\task\manager::queue_adhoc_task(). - $nextruntime = time() - 1; - $record->nextruntime = $nextruntime; - $DB->insert_record('task_adhoc', $record); - - // Main savepoint reached. - upgrade_main_savepoint(true, 2017040403.00); - } - if ($oldversion < 2017040700.01) { // Define table oauth2_issuer to be created. @@ -2838,25 +2810,6 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2017041801.00); } - if ($oldversion < 2017042600.01) { - // If the previous step didn't execute and queue the task. - if (!isset($refresheventsadhocadded)) { - // Create adhoc task for upgrading of existing calendar events. - $record = new \stdClass(); - $record->classname = "\\core\\task\\refresh_mod_calendar_events_task"; - $record->component = 'core'; - - // Next run time based from nextruntime computation in \core\task\manager::queue_adhoc_task(). - $nextruntime = time() - 1; - $record->nextruntime = $nextruntime; - $DB->insert_record('task_adhoc', $record); - - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2017042600.01); - } - if ($oldversion < 2017050500.01) { // Get the list of parent event IDs. $sql = "SELECT DISTINCT repeatid @@ -2894,5 +2847,20 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2017050500.02); } + if ($oldversion < 2017050900.01) { + // Create adhoc task for upgrading of existing calendar events. + $record = new \stdClass(); + $record->classname = '\core\task\refresh_mod_calendar_events_task'; + $record->component = 'core'; + + // Next run time based from nextruntime computation in \core\task\manager::queue_adhoc_task(). + $nextruntime = time() - 1; + $record->nextruntime = $nextruntime; + $DB->insert_record('task_adhoc', $record); + + // Main savepoint reached. + upgrade_main_savepoint(true, 2017050900.01); + } + return true; } diff --git a/version.php b/version.php index 0b7efa7f9c7..4f31d564ec5 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2017050900.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2017050900.01; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes.