Project

General

Profile

Actions

Bug #86635

closed

Plugin/Flexform fields for finisher overrides require the field to be defined in every concrete form configuration instead of falling back to the default value if the field is not set for the form

Added by S P about 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Category:
Form Framework
Target version:
-
Start date:
2018-10-12
Due date:
% Done:

100%

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

Description

What I did:
  1. I have a form configuration that uses a custom finisher without options. This works.
  2. I extended the finisher by a new option
  3. I registered the new option also at the FormEngine configuration
  4. I get a PHP warning in the Plugin flexform that has any form using this finisher selected:
    Core: Error handler (BE): PHP Warning: Invalid argument supplied for foreach() in [...]/typo3/sysext/form/Classes/Hooks/DataStructureIdentifierHook.php line 223
    

The warning is thrown because the key options in the finisher configuration in the concrete MyForm.form.yaml is not set (it had no options before, which is valid). It's conceptually wrong that this must be set. The Flexform value in the plugin should be rendered anyways and override the default value of the finisher in this case.

I expect that the override chain is Flexform -> _optional_ Form value -> default from finisher
But currently it's actually Flexform -> _mandatory_ Form value -> default from finisher.

This also has the implication that the default value of the finisher can never have any effect, because any concrete (overridable) form has to have an initial value anways.

Think of this scenario:
Someone has 100 (read: "a lot") Form configurations using a custom finisher. Now this finisher gets a new option with a reasonable default which should (not must!) be overridable in the Flexform. This person now has to edit all 100 Form configurations manually and add an initial value to every Form using this finisher even though the finisher has a default value itself which should actually be used.

Or in other words:
Extending a finisher with a new field should not invalidate the flexform of all forms using this finisher (but currently it does).

Actions

Also available in: Atom PDF