-
Bug
-
Resolution: Fixed
-
Minor
-
3.2.9, 3.5.3, 3.6.1
-
MOODLE_32_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
-
MOODLE_35_STABLE, MOODLE_36_STABLE
-
MDL-62550-master-2 -
Easy
-
The core form library used to add id=fitem_unique_id to the outer div that contained a form label/input pairing.
When the templates were added, this feature was lost for the new templates in Boost (though it's still in the core templates that emulate the old form HTML).
These id's are very handy for plugin or theme developers to target specific form element with CSS.
See MDL-60466 for an example. I've found myself resorting to fragile CSS like "target the third form item" which can break if future development or user options add or remove any items to the form.
Probably just copying the old syntax would be good.
Old syntax:
https://github.com/moodle/moodle/blob/master/lib/form/templates/element-template.mustache#L49
New, minus unique identifier:
The inline template would need changed to match
The lack of this id exhibits itself if form groups are used with addRule. There is poor support for this generally speaking, but there is an obvious console error in Boost because this id is missing:
- Open your browser's dev tools and select the console.
- Go to a course > question bank > export.
- Notice the console error.