-
Bug
-
Resolution: Fixed
-
Blocker
-
2.0.2
-
Any
-
MOODLE_20_STABLE
-
MOODLE_21_STABLE, MOODLE_22_STABLE
-
wip-mdl-27837
-
When a course has more than one self-enrolment type with enrolment keys, the "Unmask" checkboxes for keys after the first one do not show up in the correct place and don't unmask the field. See attached screenshot of a course with two self-enrolment types, each with its own key. Instead of having one Unmask checkbox next to each enrolment key field, both checkboxes appear next to the first key field. Also, the first checkbox unmasks the first key but the second checkbox does nothing--it does not unmask either key.
In the class definition of enrol_self_enrol_form, $mform->addElement() is passed the string "enrolpassword" which is used to generate the names and IDs of the fields and divs. This is fine with one enrolment type but with more than one, all the options have the same names and IDs. The Unmask checkboxes are inserted via Javascript into a div with ID: id_enrolpasswordunmaskdiv. There are two divs with that ID on the page so all the Unmask checkboxes show up for the first enrolment key, as seen in the screenshot.
Unique IDs would prevent these unexpected behaviors when there is more than one enrolment key. Perhaps using the heading as part of the string would be helpful. I tried that and it puts the checkboxes in the proper places but changing the string in the addElement() call changes the field name in addition to the div ID and the unknown name breaks the form submission. So that will need to be worked out somehow too.
- blocks
-
MDL-30160 META: Major new features for Moodle 2.2
- Closed