Skip to content
Permalink
Browse files

MDL-45418 Files: Adding upgrade steps for publisher docs

Conflicts:
	lib/db/upgrade.php
	lib/db/upgradelib.php
	version.php
  • Loading branch information...
jsnfwlr authored and stronk7 committed May 7, 2014
1 parent af21acd commit 5fd16a3761e9c315e9900cf50912bb2f674a01bc
Showing with 29 additions and 2 deletions.
  1. +7 −0 lib/db/upgrade.php
  2. +21 −1 lib/db/upgradelib.php
  3. +1 −1 version.php
@@ -2984,5 +2984,12 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2013111803.01);
}
if ($oldversion < 2013111803.05) {
// Fixing possible wrong MIME type for Publisher files.
$filetypes = array('%.pub'=>'application/x-mspublisher');
upgrade_mimetypes($filetypes);
upgrade_main_savepoint(true, 2013111803.05);
}
return true;
}
@@ -347,4 +347,24 @@ function upgrade_course_modules_sequences() {
unset($sections);
// Note that we don't need to reset course cache here because it is reset automatically after upgrade.
}
}
/**
* Updates the mime-types for files that exist in the database, based on their
* file extension.
*
* @param array $filetypes Array with file extension as the key, and mimetype as the value
*/
function upgrade_mimetypes($filetypes) {
global $DB;
$select = $DB->sql_like('filename', '?', false);
foreach ($filetypes as $extension=>$mimetype) {
$DB->set_field_select(
'files',
'mimetype',
$mimetype,
$select,
array($extension)
);
}
}
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2013111803.04; // 20131118 = branching date YYYYMMDD - do not modify!
$version = 2013111803.05; // 20131118 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.

0 comments on commit 5fd16a3

Please sign in to comment.
You can’t perform that action at this time.