Skip to content

Commit

Permalink
mod_unilabel: another fix for group form elements used in fragment api
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Grabs committed Jan 27, 2024
1 parent 898f7d4 commit bc8cd10
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion classes/output/edit_element_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ protected function get_group(string $name, array $elements, string $separator =
bool $appendname = false, $helpbutton = '', string $extralabel = '') {

$elementname = $this->prefix . $name . '_' . $this->repeatindex;
$attributes = [];
$attributes['id'] = 'id_' . $this->prefix . $name . '_' . $this->repeatindex;
$attributes['name'] = $elementname;

if (empty($extralabel)) {
$label = get_string($name, $this->component) . '-' . ($this->repeatindex + 1);
Expand All @@ -369,7 +372,7 @@ protected function get_group(string $name, array $elements, string $separator =
if ($helpbutton) {
$element->_helpbutton = $this->output->help_icon($helpbutton, $this->component);
}
$element->setAttributes([]); // The group element has no attributes but it needs at least an empty array!!!
$element->setAttributes($attributes); // The group element needs at least this attributes!!!

return $element;
}
Expand Down

0 comments on commit bc8cd10

Please sign in to comment.