Commit ed37e7e5 authored by Richard Mansfield's avatar Richard Mansfield

Modify previous upgrade to insert artefact_file_files records for profile icons

parent c2356895
......@@ -1426,6 +1426,15 @@ function xmldb_core_upgrade($oldversion=0) {
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');
if ($profileicons) {
foreach ($profileicons as $a) {
$size = filesize($artefactdata . 'file/profileicons/originals/' . ($a % 256) . '/' . $a);
insert_record('artefact_file_files', (object) array('artefact' => $a, 'fileid' => $a, 'size' => $size));
}
}
}
return $status;
......
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