Skip to content

Commit

Permalink
Merge branch 'wip-MDL-34669-MOODLE_22_STABLE' of git://github.com/mar…
Browse files Browse the repository at this point in the history
…inaglancy/moodle into MOODLE_22_STABLE
  • Loading branch information
danpoltawski committed Aug 7, 2012
2 parents 12b7b43 + 1d8cd19 commit c8a6057
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/form/editor.php
Expand Up @@ -32,7 +32,12 @@ function MoodleQuickForm_editor($elementName=null, $elementLabel=null, $attribut
$this->_options['maxbytes'] = get_max_upload_file_size($CFG->maxbytes, $options['maxbytes']);
}
if (!$this->_options['context']) {
$this->_options['context'] = get_context_instance(CONTEXT_SYSTEM);
// trying to set context to the current page context to make legacy files show in filepicker (e.g. forum post)
if (!empty($PAGE->context->id)) {
$this->_options['context'] = $PAGE->context;
} else {
$this->_options['context'] = context_system::instance();
}
}
$this->_options['trusted'] = trusttext_trusted($this->_options['context']);
parent::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
Expand Down

0 comments on commit c8a6057

Please sign in to comment.