Project

General

Profile

Actions

Bug #106151

open

PHP warning for unset validators

Added by Simon Praetorius about 1 month ago. Updated about 1 month ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2025-02-11
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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
Actions #1

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.

Actions

Also available in: Atom PDF