From 021a143914c206d030cb69486d57c3249a428424 Mon Sep 17 00:00:00 2001 From: Jake Dallimore Date: Mon, 8 May 2017 12:26:16 +0800 Subject: [PATCH] MDL-58684 upgrade: re-run deletion of portfolio_tempdata upgrade step --- lib/db/upgrade.php | 30 +++++++++++++++--------------- version.php | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 6d1a188e6d9..8e08d74eae1 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -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; } diff --git a/version.php b/version.php index 0352d306180..fa2dc673fa9 100644 --- a/version.php +++ b/version.php @@ -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.