Issue Bug Closed

#99719Saving an empty form leads to a defective yaml configuration

Thomas Balko 01/25/23, 15:43 updated 05/12/24, 13:54

Description

Steps to reproduce the issue

  • In the forms mdoule create a new blank form, give it a name and click “finish!”.
    Bildschirmfoto%202023-01-25%20um%2016.07.43.png
  • In the now following mask: Edit nothing just click “save” and then close
    Bildschirmfoto%202023-01-25%20um%2016.10.20.png
  • You now have created a defective yaml conf. When you download and look at the resulting yaml file you will see that it created an entry inside fieldState of the type “Page”, but there is no form element of the type “Page”, what will cause an error later.

renderingOptions:
  submitButtonLabel: Submit
  fieldState:
    page-1:
      type: Page
      identifier: page-1
      label: Step
      renderingOptions:
        deleted: 1
        listView: 1
type: Form
identifier: testblankform
label: 'Test blank form'
prototypeName: standard
renderables:
  -
    renderingOptions:
      previousButtonLabel: 'Previous step'
      nextButtonLabel: 'Next step'
    type: Page
    identifier: page-1
    label: Step

The editor doesn’t see that there is something off with the form config. They can continue to edit the form, set fields and finishers and implement the form into the web page.
When the editor later tries to check the form results in the “Form results” BE module they will recieve the following error:

> #1327318156 TYPO3\CMS\Form\Domain\Exception\TypeDefinitionNotValidException
> The “implementationClassName” for element “page-1“ (“TYPO3\CMS\Form\Domain\Model\FormElements\Page”) does not implement the FormElementInterface.

The form can be fixed by removing the faulty “page-1” entry in the YAML config. Also the form results can then be accesed without problems. But this is not a good solution, because it require server file acces priviliges and is inaccessible for normal editors.

Excpected behaviour

Saving an empty form should not result in a defective yaml config. (Don’t save the step information inside the fieldState-node when there are no fields selected)

More Info

Operating system: Unix
PHP Version: 7.4.28
TYPO3 Version: 10.4.34
EXT:form Version: 10.4.34
EXT:form_to_database Version: 2.0.4

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.