Commit 4ac07636 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.
parent f8fa229c
...@@ -619,15 +619,16 @@ function xmldb_core_upgrade($oldversion=0) { ...@@ -619,15 +619,16 @@ function xmldb_core_upgrade($oldversion=0) {
if ($oldversion < 2008101602) { if ($oldversion < 2008101602) {
// Move artefact/internal/profileicons directory to artefact/file // 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/'; $artefactdata = get_config('dataroot') . 'artefact/';
if (is_dir($artefactdata . 'internal/profileicons')) { if (is_dir($artefactdata . 'internal/profileicons')) {
if (!is_dir($artefactdata . 'file')) { if (!is_dir($artefactdata . 'file')) {
mkdir($artefactdata . 'file'); mkdir($artefactdata . 'file');
} }
rename($artefactdata . 'internal/profileicons', $artefactdata . 'file/profileicons'); 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 // Insert artefact_file_files records for all profileicons
$profileicons = get_column('artefact', 'id', 'artefacttype', 'profileicon'); $profileicons = get_column('artefact', 'id', 'artefacttype', 'profileicon');
......
Supports Markdown
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