Permalink
Browse files

MDL-41034 fix TinyMCE managefiles plugin for textareas that do not su…

…pport file uploads

The current managefiles plugin assumes that every file manager will be created
by either calling use_editor without filepicker options ($fpoptions) or with
filepicker options that include options for the moodleimage plugin.
  • Loading branch information...
1 parent a31e811 commit f936128f5b63ac563512e80c6802876f97857110 @ktemkin ktemkin committed Aug 5, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/editor/tinymce/plugins/managefiles/tinymce/editor_plugin.js
@@ -93,7 +93,9 @@
var managefiles = ed.getParam('managefiles', {});
// Get draft area id from filepicker options.
- if (!managefiles.itemid && M.editor_tinymce.filepicker_options && M.editor_tinymce.filepicker_options[ed.id]) {
+ if (!managefiles.itemid && M.editor_tinymce.filepicker_options
+ && M.editor_tinymce.filepicker_options[ed.id]
+ && M.editor_tinymce.filepicker_options[ed.id].image) {
managefiles.itemid = M.editor_tinymce.filepicker_options[ed.id].image.itemid;
ed.settings['managefiles'].itemid = managefiles.itemid;
}

0 comments on commit f936128

Please sign in to comment.