Commit 6c1cc361 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Make filetype upgrade less stupid when there are lots of copied files around


Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 5dc41d91
...@@ -266,7 +266,7 @@ function xmldb_artefact_file_upgrade($oldversion=0) { ...@@ -266,7 +266,7 @@ function xmldb_artefact_file_upgrade($oldversion=0) {
require_once('file.php'); require_once('file.php');
foreach ($records as &$r) { foreach ($records as &$r) {
$path = get_config('dataroot') . 'artefact/file/originals/' . $r->fileid % 256 . '/' . $r->fileid; $path = get_config('dataroot') . 'artefact/file/originals/' . $r->fileid % 256 . '/' . $r->fileid;
set_field('artefact_file_files', 'filetype', file_mime_type($path), 'fileid', $r->fileid); set_field('artefact_file_files', 'filetype', file_mime_type($path), 'fileid', $r->fileid, 'artefact', $r->artefact);
} }
} }
} }
......
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