Commit 71969c30 authored by Nigel McNie's avatar Nigel McNie
Browse files

Unconditionally update artefact type for profile icons.

Prevents upgrade crash when there's no profile icons in the system.
(cherry picked from commit 4ac07636)
parent bd99a378
......@@ -619,15 +619,16 @@ function xmldb_core_upgrade($oldversion=0) {
if ($oldversion < 2008101602) {
// Move artefact/internal/profileicons directory to artefact/file
set_field('artefact_installed_type', 'plugin', 'file', 'name', 'profileicon');
set_field('artefact_config', 'plugin', 'file', 'field', 'profileiconwidth');
set_field('artefact_config', 'plugin', 'file', 'field', 'profileiconheight');
$artefactdata = get_config('dataroot') . 'artefact/';
if (is_dir($artefactdata . 'internal/profileicons')) {
if (!is_dir($artefactdata . 'file')) {
mkdir($artefactdata . 'file');
}
rename($artefactdata . 'internal/profileicons', $artefactdata . 'file/profileicons');
set_field('artefact_installed_type', 'plugin', 'file', 'name', 'profileicon');
set_field('artefact_config', 'plugin', 'file', 'field', 'profileiconwidth');
set_field('artefact_config', 'plugin', 'file', 'field', 'profileiconheight');
// Insert artefact_file_files records for all profileicons
$profileicons = get_column('artefact', 'id', 'artefacttype', 'profileicon');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment