diff --git a/lib/form/filemanager.js b/lib/form/filemanager.js index 58ceaf727a2..ac8b80a9ff4 100644 --- a/lib/form/filemanager.js +++ b/lib/form/filemanager.js @@ -69,6 +69,7 @@ M.form_filemanager.init = function(Y, options) { this.filepicker_options.maxbytes = this.maxbytes; this.filepicker_options.env = 'filemanager'; this.filepicker_options.itemid = options.itemid; + this.filepicker_options.accepted_types = options.accepted_types; if (options.filecount) { this.filecount = options.filecount; diff --git a/lib/form/filemanager.php b/lib/form/filemanager.php index b1ed740330f..98e84080406 100644 --- a/lib/form/filemanager.php +++ b/lib/form/filemanager.php @@ -124,7 +124,7 @@ class MoodleQuickForm_filemanager extends HTML_QuickForm_element { $subdirs = $this->_options['subdirs']; $maxbytes = $this->_options['maxbytes']; $draftitemid = $this->getValue(); - $accepted_types = $this->_options['accepted_types']; + $accepted_types = (array) $this->_options['accepted_types']; if (empty($draftitemid)) { // no existing area info provided - let's use fresh new draft area