MDL-58684 upgrade: re-run deletion of portfolio_tempdata upgrade step

This commit is contained in:
Jake Dallimore 2017-05-08 12:26:16 +08:00
parent 1d5a366488
commit 021a143914
2 changed files with 16 additions and 16 deletions

View File

@ -2857,21 +2857,6 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2017042600.01);
}
if ($oldversion < 2017050300.01) {
// MDL-58684:
// Remove all portfolio_tempdata records as these may contain serialized \file_system type objects, which are now unable to
// be unserialized because of changes to the file storage API made in MDL-46375. Portfolio now stores an id reference to
// files instead of the object.
// These records are normally removed after a successful export, however, can be left behind if the user abandons the
// export attempt (a stale record). Additionally, each stale record cannot be reused and is normally cleaned up by the cron
// task core\task\portfolio_cron_task. Since the cron task tries to unserialize them, and generates a warning, we'll remove
// all records here.
$DB->delete_records_select('portfolio_tempdata', 'id > ?', [0]);
// Main savepoint reached.
upgrade_main_savepoint(true, 2017050300.01);
}
if ($oldversion < 2017050500.01) {
// Get the list of parent event IDs.
$sql = "SELECT DISTINCT repeatid
@ -2894,5 +2879,20 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2017050500.01);
}
if ($oldversion < 2017050500.02) {
// MDL-58684:
// Remove all portfolio_tempdata records as these may contain serialized \file_system type objects, which are now unable to
// be unserialized because of changes to the file storage API made in MDL-46375. Portfolio now stores an id reference to
// files instead of the object.
// These records are normally removed after a successful export, however, can be left behind if the user abandons the
// export attempt (a stale record). Additionally, each stale record cannot be reused and is normally cleaned up by the cron
// task core\task\portfolio_cron_task. Since the cron task tries to unserialize them, and generates a warning, we'll remove
// all records here.
$DB->delete_records_select('portfolio_tempdata', 'id > ?', [0]);
// Main savepoint reached.
upgrade_main_savepoint(true, 2017050500.02);
}
return true;
}

View File

@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2017050500.01; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2017050500.02; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.