From 6fcc509ed15c719dcbb065fa859db3f8b7de7a98 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Fri, 21 Aug 2020 17:45:41 +0200 Subject: [PATCH] MDL-68909 h5p: upgrade step to remove files in editor filearea As temporary editor files have been moved from core_h5p/editor to user/draft, they can be removed (to clean unused DB entries). --- lib/db/upgrade.php | 10 ++++++++++ version.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 60ac97001ff..5d8760a8a02 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2684,5 +2684,15 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2020082200.03); } + if ($oldversion < 2020091000.02) { + // Remove all the files with component='core_h5p' and filearea='editor' because they won't be used anymore. + $fs = get_file_storage(); + $syscontext = context_system::instance(); + $fs->delete_area_files($syscontext->id, 'core_h5p', 'editor'); + + // Main savepoint reached. + upgrade_main_savepoint(true, 2020091000.02); + } + return true; } diff --git a/version.php b/version.php index 69dc1a4e4f5..d0decbb5074 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2020091000.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2020091000.02; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes. $release = '3.10dev (Build: 20200910)';// Human-friendly version name