neos / form

Flow Form Framework
https://flow-form-framework.readthedocs.org/en/latest/
MIT License
15 stars 36 forks source link

BUGFIX: mapValueToOption should always return string #141

Closed Nikdro closed 3 years ago

Nikdro commented 3 years ago

We got problems with forms using select-lists with customized options, when they are optional and broke it down to this method while debugging.

When the input is optional and not selected, both ($options[$value] and $value) where empty (NULL) in our cases.
Since the method-signature requires the method to return a string, this fails with Return value of Neos\Form\ViewHelpers\RenderValuesViewHelper_Original::mapValueToOption() must be of the type string, null returned.
Probably this was introduced with the strict-types declaration

I solved it by simply adding an empty string as fallback-value here and think that should also get into the Neos.Form-Core.