Commit f9ebcaba authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Move filetype upgrade into file plugin to avoid failure in upgrade from pre-2008101602


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 7c497378
......@@ -261,6 +261,15 @@ function xmldb_artefact_file_upgrade($oldversion=0) {
}
}
if ($oldversion < 2010012702) {
if ($records = get_records_sql_array("SELECT * FROM {artefact_file_files} WHERE filetype='application/octet-stream'", array())) {
foreach ($records as &$r) {
$path = get_config('dataroot') . 'artefact/file/originals/' . $r->fileid % 256 . '/' . $r->fileid;
set_field('artefact_file_files', 'filetype', mime_content_type($path), 'fileid', $r->fileid);
}
}
}
return $status;
}
......
......@@ -28,7 +28,7 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2009111200;
$config->version = 2010012702;
$config->release = '1.2.0';
?>
......@@ -1339,15 +1339,6 @@ function xmldb_core_upgrade($oldversion=0) {
set_config('userscanchooseviewthemes', 1);
}
if ($oldversion < 2010012702) {
if ($records = get_records_sql_array("SELECT * FROM {artefact_file_files} WHERE filetype='application/octet-stream'", array())) {
foreach ($records as &$r) {
$path = get_config('dataroot') . 'artefact/file/originals/' . $r->fileid % 256 . '/' . $r->fileid;
set_field('artefact_file_files', 'filetype', mime_content_type($path), 'fileid', $r->fileid);
}
}
}
if ($oldversion < 2010021500) {
if ($data = check_upgrades('blocktype.recentforumposts')) {
upgrade_plugin($data);
......
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