Skip to content

Commit

Permalink
Fix bug in handleListElement
Browse files Browse the repository at this point in the history
  • Loading branch information
dafeder committed Nov 22, 2023
1 parent fce7efc commit eafd0f8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions modules/json_form_widget/src/WidgetRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,19 @@ public function getWidgets() {
* The element configured as a list element.
*/
public function handleListElement($spec, array $element) {
if (isset($spec->titleProperty) && isset($element[$spec->titleProperty])) {
$element[$spec->titleProperty] = $this->getDropdownElement($element[$spec->titleProperty], $spec, $spec->titleProperty);
$title_property = ($spec->titleProperty ?? FALSE);

if (isset($title_property, $element[$title_property])) {
$element[$title_property] = $this->getDropdownElement($element[$title_property], $spec, $title_property);
}
elseif (isset($spec->source->returnValue) && isset($element[$spec->titleProperty])) {
$element = $this->getDropdownElement($element, $spec, $spec->titleProperty);

if (isset($spec->source->returnValue)) {
$element = $this->getDropdownElement($element, $spec, $title_property);
}
else {
$element = $this->getDropdownElement($element, $spec, $spec->titleProperty ?? FALSE);
elseif (!isset($spec->titleProperty)) {
$element = $this->getDropdownElement($element, $spec);
}

return $element;
}

Expand Down

0 comments on commit eafd0f8

Please sign in to comment.