Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Ready for review

96746[FEATURE] Offer stored forms in new content element wizard

Josua Vogel CR 0 V 0 Hard +660 −5 updated 11/19/26, 10:21

Commit message

A wizard item of the "Create new content element" wizard can now name
a form in its Page TSconfig default values, by its persistence
identifier: the path of a form file or the uid of a database form. The
form content element it creates has this form preselected:

  mod.wizards.newContentElement.wizardItems.forms.elements {
    contact.tt_content_defValues {
      CType = form_formframework
      persistenceIdentifier = 12
    }
  }

The item takes label, description and icon from the form definition
unless it sets them itself. A form definition can carry an optional
description, editable in the form editor, and form definition files
can name a registered icon. Items of forms that are missing, invalid
or not readable for the backend user are removed.

Grouping, sorting, removeItems, inheritance and the content type
restrictions are the wizard's own, so integrators decide per site
which forms are offered.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 7
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/46/96746/7 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/46/96746/7 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Issues 1

Files 17

Review log 1724

  1. Josua Vogel uploaded patch set 1 10/16/26, 05:48

  2. core-ci voted on patch set 1 V +1 10/16/26, 05:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111313

  3. Josua Vogel commented on patch set 1 10/28/26, 10:49

    This change is ready for review.
  4. Soren Malling voted on patch set 1 V +1 10/29/26, 06:40

  5. Oli Bartsch commented on patch set 1 10/29/26, 08:29

    FormMetadata.php:140

    `with()` takes `description`, `iconIdentifier` and `hideInNewContentElementWizard` from `$this` and ignores `$changes`, unlike the other fields. Please use `$changes['description'] ?? $this->description` and the same for the others.

    ModifyNewContentElementWizardItemsEventListener.php:37

    The generic form item is found via the hard-coded key `<group>_form_formframework`. If the element is moved to another group or redefined in Page TSconfig, the listener returns early and the feature silently does nothing. Suggest to locate the item by `defaultValues.CType === 'form_formframework'`, like `removeWizardsByBackendLayoutColPosRestriction` does, and insert after the key you find.

    ModifyNewContentElementWizardItemsEventListener.php:38

    Only the extension and database storages are queried, while `listForms()` iterates `getAllAdapters()`. Forms from other adapters therefore show up in the FlexForm select but not in the wizard. Suggest to iterate all adapters or document the restriction.

    ModifyNewContentElementWizardItemsEventListener.php:39

    `DatabaseStorageAdapter::findAll` never sets `iconIdentifier`, so the storage-type check never matters, and a form moved to the database silently loses its icon. Either drop `iconIdentifier` from this change (and remove the constant) or streamline the support.

    ModifyNewContentElementWizardItemsEventListener.php:52

    I think this is the wrong switch. AFAICS there is no way to disable just the new feature. You would need to either adjust every form or disable form element in general. Suggest to add Page TsConfig here. Also note that people might already define such specific form elements already on their own. So this would now duplicate them. I think this should at least be mentioned in the rst.

    ModifyNewContentElementWizardItemsEventListener.php:116

    suggest to use a simple string comparison as long as we have only one type.

    AbstractFileStorageAdapter.php:119

    This reads the first line only. So a multi-line YAML `description` ends up empty or truncated without any error. Please document that it must be a single-line value, or accept the limitation explicitly.

    ModifyNewContentElementWizardItemsEventListenerTest.php:146

    The test calls the listener directly as admin, so a broken `#[AsEventListener]` registration or a permission regression would go unnoticed. Please dispatch via `EventDispatcherInterface` and add cases for `be_users` uid 2 (no database forms) and uid 3.
  6. Josua Vogel uploaded patch set 2 V +1 11/09/26, 12:48

  7. core-ci voted on patch set 2 V +1 11/09/26, 13:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113668

  8. Josua Vogel uploaded patch set 3 V +1 11/09/26, 13:08

  9. core-ci voted on patch set 3 V +1 11/09/26, 13:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113682

  10. Josua Vogel uploaded patch set 4 V +1 11/09/26, 13:51

  11. Josua Vogel commented on patch set 4 11/09/26, 13:54

    FormMetadata.php:140 Reply

    Done

    ModifyNewContentElementWizardItemsEventListener.php:37 Reply

    Done

    ModifyNewContentElementWizardItemsEventListener.php:38 Reply

    Done

    ModifyNewContentElementWizardItemsEventListener.php:39 Reply

    Done

    ModifyNewContentElementWizardItemsEventListener.php:52 Reply

    Done

    ModifyNewContentElementWizardItemsEventListener.php:116 Reply

    Done

    AbstractFileStorageAdapter.php:119 Reply

    Fixed in the underlying change https://review.typo3.org/c/Packages/TYPO3.CMS/+/97438 (#111381)

    ModifyNewContentElementWizardItemsEventListenerTest.php:146 Reply

    Done
  12. core-ci voted on patch set 4 V +1 11/09/26, 14:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113690

  13. Josua Vogel rebased onto patch set 5 V +1 11/13/26, 09:39

  14. core-ci voted on patch set 5 V +1 11/13/26, 09:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114298

  15. Soren Malling voted on patch set 5 V +1 11/13/26, 10:19

  16. Dennis Purisevic commented on patch set 5 11/16/26, 12:37

    Two general questions: 1. Wouldn’t it be better to put the form definitions into their own separate group, “Form definitions”? This way, a user can clearly differentiate between what are programmed forms and what are just definitions. 2. Should the inclusion of the form definitions in the new content element wizard be opt-in instead of opt-out? Currently, all form definitions would be present and would have to be disabled one by one.
  17. Josua Vogel commented on patch set 5 11/16/26, 19:37

    Reply

    Thanks for taking a look at the patch. 1. That could be done, but I think editors rarely distinguish between programmed forms and form definitions. To most of them, they’re just forms. 2. Personally, I prefer the opt-out option, since I believe the new layout improves the UX and is therefore the preferred approach.
  18. Dennis Purisevic commented on patch set 5 11/17/26, 08:39

    Reply

    Yea, no problem, the ext:form needs some love :D I can agree with you on the first point. On the second one, however, I have to disagree. One example: in a installation with around 10-30 forms, having all of them displayed in the wizard from the start, and therefore in two places (wizard and select), is a bit too much as a default. Yes, you could write an upgrade wizard, but displaying new ones by default is, in my opinion, too much. Where this could really be superior is in enabling it for the most-used form definitions. All forms would be in the select but all the important ones can be enabled to be displayed and used in the wizard. Maybe you have another view on the point I've made. Or we need a third opinion since we are biased, and asking my coworker wont make this better :D
  19. Josua Vogel uploaded patch set 6 V +1 11/17/26, 15:21

  20. core-ci voted on patch set 6 V +1 11/17/26, 15:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114750

  21. Josua Vogel marked it ready for review 11/17/26, 15:42

  22. Josua Vogel commented on patch set 6 11/17/26, 15:44

    Reply

    you convinced me 😊 I thought more about this and I think we need the possibility to control it per site. I added a new approach in page tsconfig
  23. Josua Vogel uploaded patch set 7 V +1 11/19/26, 10:13

  24. core-ci voted on patch set 7 V +1 11/19/26, 10:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114997