mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 14:03:52 +01:00
MDL-34669: Fix editor filepicker context bt trying to use page context
This commit is contained in:
parent
470d47f512
commit
a8d259553d
@ -80,7 +80,12 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element {
|
||||
$this->_options['maxbytes'] = get_max_upload_file_size($CFG->maxbytes, $options['maxbytes']);
|
||||
}
|
||||
if (!$this->_options['context']) {
|
||||
$this->_options['context'] = context_system::instance();
|
||||
// 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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user