mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-56282 enrol_meta: Fix error when editing existing instances
We had a few problems here. 1/ The auto complete element was displaying the picker though the field was frozen. 2/ Checking for existing enrolment including the courses chosen was not checking if the courses found were in the instance we edit. 3/ Upon creation we support multiple courses but when editing we should not expect more than the course in the instance being edited.
This commit is contained in:
parent
09a05b798b
commit
77bec234e0
2 changed files with 18 additions and 6 deletions
|
@ -121,8 +121,11 @@ class MoodleQuickForm_autocomplete extends MoodleQuickForm_select {
|
|||
// Enhance the select with javascript.
|
||||
$this->_generateId();
|
||||
$id = $this->getAttribute('id');
|
||||
$PAGE->requires->js_call_amd('core/form-autocomplete', 'enhance', $params = array('#' . $id, $this->tags, $this->ajax,
|
||||
$this->placeholder, $this->casesensitive, $this->showsuggestions, $this->noselectionstring));
|
||||
|
||||
if (!$this->isFrozen()) {
|
||||
$PAGE->requires->js_call_amd('core/form-autocomplete', 'enhance', $params = array('#' . $id, $this->tags, $this->ajax,
|
||||
$this->placeholder, $this->casesensitive, $this->showsuggestions, $this->noselectionstring));
|
||||
}
|
||||
|
||||
return parent::toHTML();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue