Skip to content

Commit

Permalink
fix FieldHelper.php fieldType missing fieldSelectOptions issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Dec 15, 2024
1 parent e7ff552 commit 2111942
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/src/View/Helper/FieldHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,11 @@ public function formField(string $fieldName,

// Get the field type from the map of fields (e.g. 'boolean', 'string', 'timestamp')
$fieldType = $fieldType ?? $this->getFieldType($fieldName);
// $fieldType=select requires the $fieldSelectOptions. If the options are empty, we will
// force the usage of the default option
if(empty($fieldSelectOptions) && $fieldType === 'select') {
$fieldType = '';
}
// Generate the form control or pass along the markup generated in a wrapper function
return match($fieldType) {
// A boolean field is a checkbox. Set the label and class to improve rendering
Expand Down

0 comments on commit 2111942

Please sign in to comment.