Bug #86635
closedPlugin/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
100%
Description
- I have a form configuration that uses a custom finisher without options. This works.
- I extended the finisher by a new option
- I registered the new option also at the FormEngine configuration
- 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).
Updated by S P about 6 years ago
Or to state it in a more direct way:
The flexform in the plugin for the finisher overrides should simply show the overridable fields defined in the finisher (finishersDefinition.FinisherKey.FormEngine.elements
). Currently it wrongly shows only the intersection between finishersDefinition.FinisherKey.FormEngine.elements
and the options already set in the specific selected form (this has the ugly side effect that different forms can show different fields for the same finisher!). And if these options also happen to be empty (because the finisher was later extended by the new field witout adjusting all forms) the PHP warning is shown in addition.
Updated by Ralf Zimmermann over 5 years ago
- Status changed from New to In Progress
Updated by Gerrit Code Review over 5 years ago
- Status changed from In Progress to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60577
Updated by Gerrit Code Review over 5 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60577
Updated by Gerrit Code Review over 5 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60577
Updated by Gerrit Code Review over 5 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60577
Updated by Gerrit Code Review over 5 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60577
Updated by Gerrit Code Review over 5 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60577
Updated by Gerrit Code Review over 5 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60577
Updated by Gerrit Code Review over 5 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60577
Updated by Gerrit Code Review over 5 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60577
Updated by Gerrit Code Review over 5 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60597
Updated by Anonymous over 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 548515458b6fcad696ff0e2c225d5ff46b17c2d3.