Bug #106151
openPHP warning for unset validators
0%
Description
I'm getting the following PHP warning in TYPO3 v12:
Core: Error handler (FE): PHP Warning: foreach() argument must be of type array|object, string given in /path/to/typo3/vendor/typo3/cms-form/Classes/Domain/Model/Renderable/AbstractRenderable.php line 153
My guess for the origin of this warning would be that the form in question uses __UNSET
to disable validators for certain form variants:
- defaultValue: '' type: Email identifier: locationEmail label: Email variants: - identifier: locationEmail-optional condition: 'traverse(formValues, "useOperatorDataForLocation") == 1' validators: __UNSET validators: - identifier: EmailAddress - identifier: NotEmpty
Updated by Christian Kuhn about 1 month ago
· Edited
quick feedback on reading the issue:
imho: _UNSET is doomed in almost all cases and we should in general avoid relying on it, except there are very good reasons that can't be solved differently and that are absolutely safe to use. we've run into various "_UNSET fucks up everything" cases in the past already.
i don't deny such a patch up front, but it should be argued wisely.