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 Stefan P over 5 years ago. Updated almost 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 #1

Updated by Stefan P over 5 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.

Actions #2

Updated by Ralf Zimmermann over 5 years ago

  • Assignee set to Ralf Zimmermann
Actions #3

Updated by Björn Jacob about 5 years ago

  • Sprint Focus set to Remote Sprint
Actions #4

Updated by Ralf Zimmermann almost 5 years ago

  • Status changed from New to In Progress
Actions #5

Updated by Gerrit Code Review almost 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

Actions #6

Updated by Gerrit Code Review almost 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

Actions #7

Updated by Ralf Zimmermann almost 5 years ago

  • TYPO3 Version changed from 8 to 9
Actions #8

Updated by Gerrit Code Review almost 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

Actions #9

Updated by Gerrit Code Review almost 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

Actions #10

Updated by Gerrit Code Review almost 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

Actions #11

Updated by Gerrit Code Review almost 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

Actions #12

Updated by Gerrit Code Review almost 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

Actions #13

Updated by Gerrit Code Review almost 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

Actions #14

Updated by Gerrit Code Review almost 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

Actions #15

Updated by Gerrit Code Review almost 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

Actions #16

Updated by Anonymous almost 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #17

Updated by Benni Mack almost 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF