Skip to content

Commit

Permalink
Fix 'Image Icon and Video Icon: Browse Repository button does not get…
Browse files Browse the repository at this point in the history
… any action to proceed to next screen' - #29.
  • Loading branch information
gjb2048 committed Oct 12, 2023
1 parent 3d858e8 commit 83e6677
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Version Information

Version 403.1.1 - TBR
--------------------------
1. Fix 'Image Icon and Video Icon: Browse Repository button does not get any action to proceed to next screen' - #29.

Version 403.1.0 - 08/10/23
--------------------------
Expand Down
15 changes: 15 additions & 0 deletions classes/output/core_renderer_toolbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,21 @@ public function mform_element($element, $required, $advanced, $error, $ingroup)
}
}

// Generate the form element wrapper ids and names to pass to the template.
// This differs between group and non-group elements.
if ($element->getType() === 'group') {
// Group element.
// The id will be something like 'fgroup_id_NAME'. E.g. fgroup_id_mygroup.
$elementcontext['wrapperid'] = $elementcontext['id'];

// Ensure group elements pass through the group name as the element name.
$elementcontext['name'] = $elementcontext['groupname'];
} else {
// Non grouped element.
// Creates an id like 'fitem_id_NAME'. E.g. fitem_id_mytextelement.
$elementcontext['wrapperid'] = 'fitem_' . $elementcontext['id'];
}

$context = [
'element' => $elementcontext,
'label' => $label,
Expand Down

1 comment on commit 83e6677

@ngberger2015
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super! Sorted! Many thanks.
Norbert

Please sign in to comment.