-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
2.4.1
-
MOODLE_24_STABLE
I've just freshly installed Moodle 24 STABLE.
Doing a simple editor is ridiculously inefficent and costs *100* queries for a student:
$mform->addElement('editor', 'test', 'test', null, array('maxfiles'=>EDITOR_UNLIMITED_FILES, 'noclean'=>true, 'context'=>$PAGE->context));
|
Here is a test file which demonstrates the issue:
<?php
|
|
require_once('config.php');
|
require_once($CFG->libdir . '/formslib.php');
|
|
class test_form extends moodleform {
|
public function definition() {
|
global $PAGE;
|
$mform = & $this->_form;
|
$mform->addElement('editor', 'test', 'test', null, array('maxfiles'=>EDITOR_UNLIMITED_FILES, 'noclean'=>true, 'context'=>$PAGE->context));
|
}
|
}
|
|
$PAGE->set_context(context_system::instance());
|
$PAGE->set_url(new moodle_url('/testform.php'));
|
echo $OUTPUT->header();
|
$mform = new test_form();
|
$mform->display();
|
echo $OUTPUT->footer();
|
Repositories list should not be populated and passed in JS variables three times for each textarea. Actually it should not be pre-populated at all, filepicker should do it in AJAX request when opened for the first time (if ever opened at all). Also draftareaid should be passed only once as mentioned in MDL-41046 (closed as a duplicate)