Skip to content

Commit

Permalink
MDL-68909 h5p: upgrade step to remove files in editor filearea
Browse files Browse the repository at this point in the history
As temporary editor files have been moved from core_h5p/editor to
user/draft, they can be removed (to clean unused DB entries).
  • Loading branch information
sarjona committed Sep 10, 2020
1 parent d4d798e commit 6d4e245
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2684,5 +2684,15 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2021052500.06);
}

if ($oldversion < 2021052500.13) {
// 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, 2021052500.13);
}

return true;
}
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

defined('MOODLE_INTERNAL') || die();

$version = 2021052500.12; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2021052500.13; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '4.0dev (Build: 20200910)'; // Human-friendly version name
Expand Down

0 comments on commit 6d4e245

Please sign in to comment.