MDL-71336 forms: ensure grouped date elements have unique IDs.
Previously they were each taking the ID of their parent group element.
This commit is contained in:
@@ -164,6 +164,16 @@ class MoodleQuickForm_group extends HTML_QuickForm_group implements templatable
|
||||
return call_user_func_array([$this->_mform, 'createElement'], func_get_args());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return attributes suitable for passing to {@see createFormElement}, comprised of all group attributes without ID in
|
||||
* order to ensure uniqueness of that value within the group
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAttributesForFormElement(): array {
|
||||
return array_diff_key((array) $this->getAttributes(), array_flip(['id']));
|
||||
}
|
||||
|
||||
public function export_for_template(renderer_base $output) {
|
||||
global $OUTPUT;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user