Review main Merged Breaking

90521[!!!][FEATURE] Add PSR-14 Event to manipulate form creation

Josua Vogel CR +2 V +2 Normal +203 −11 updated 09/06/25, 11:32

Commit message

A new PSR-14 event TYPO3\CMS\Form\Event\BeforeFormCreateEvent
is introduced. It serves as a direct replacement for the now
removed hook $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeFormCreate'].

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
    • core-ci +1 CI

Issues 1

Files 7

Review log 2432

Show 57 earlier messages
  1. Josua Vogel uploaded patch set 1 08/30/25, 13:22

  2. core-ci voted on patch set 1 V -1 08/30/25, 13:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84045

  3. Josua Vogel uploaded patch set 2 V -1 08/30/25, 13:35

  4. core-ci voted on patch set 2 V +1 08/30/25, 13:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84046

  5. Chris Müller commented on patch set 2 08/30/25, 15:46

    BeforeFormCreateEvent.php:38

    I suggest to add either a phpstan type declaration for the array returned or at least a comment to ease getting the structure of that array for users without debugging.

    BeforeFormCreateHookProvider.php:26

    I assume, you mean v15? Additionally, you can still be breaking at this time, so IMHO you can drop the hook completely. Extension authors can implement the hook and the event side-by-side to be compatible with v13 and v14.
  6. Josua Vogel uploaded patch set 3 V +1 09/01/25, 05:51

  7. Josua Vogel commented on patch set 3 09/01/25, 05:53

    BeforeFormCreateEvent.php:38 Reply

    Done

    BeforeFormCreateHookProvider.php:26 Reply

    Well, I talked with Oli beforehand. You´re right, but this way is the better strategy.
  1. core-ci voted on patch set 3 V +1 09/01/25, 05:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84125

  2. Josua Vogel commented on patch set 3 09/01/25, 06:23

    BeforeFormCreateHookProvider.php:26 Reply

    Done
  3. Benni Mack commented on patch set 3 CR -1 09/02/25, 09:28

    Hey Josua, thanks for the patch. how about we'll migrate all hooks to events at once? In addition, let's remove the hook directly (= Breaking instead of deprecation). We can do this because we're before 14.0. Plus: Extension authors can be compatible without a deprecation notice by implementing the hook (v13 and before) AND the event listener in v14+. Feel free to use better names for the Events instead of a 1:1 copy. "BeforeFormCreateEvent" => "BeforeFormIsCreatedEvent" (or even "BeforeFormIsInitiallyPersistedEvent")
  4. Josua Vogel commented on patch set 3 09/02/25, 12:59

    Reply

    Hi Benni, thx! Yes I can do all events at once. Oli told me to split 😊 so what´s the preferred way? And yes, I will drop the hook and make this breaking
  5. Benni Mack commented on patch set 3 09/02/25, 13:11

    Reply

    OK. Just go one at a time!
  6. Josua Vogel uploaded patch set 4 CR -1 V +1 09/02/25, 14:40

  7. core-ci voted on patch set 4 V +1 09/02/25, 14:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84259

  8. Christiane Helmchen voted on patch set 4 V +1 09/02/25, 16:56

  9. Christiane Helmchen voted on patch set 4 CR +1 09/02/25, 16:57

  10. Oli Bartsch commented on patch set 4 V -1 09/02/25, 17:55

    Feature-107343-IntroducePSR14EventBeforeFormCreate.rst:17

    I suggest to add sth. like "The event is dispatched right before a new form is created in the backend." People might not know the hook and should still understand what this event is for / where it is dispatched. Please also list and describe all provided information by the event.

    Feature-107343-IntroducePSR14EventBeforeFormCreate.rst:22

    An example event listener could look like

    Feature-107343-IntroducePSR14EventBeforeFormCreate.rst:26

    This is not used :)

    Feature-107343-IntroducePSR14EventBeforeFormCreate.rst:29

    Let's use method arguments so we show that a class can contain multiple listeners.

    BeforeFormIsCreatedEvent.php:21

    This is wrong.

    BeforeFormIsCreatedEvent.php:33

    Do we really want to allow modifying the `$formPersistenceIdentifier`?
  11. Josua Vogel commented on patch set 4 09/02/25, 18:31

    BeforeFormIsCreatedEvent.php:33 Reply

    It's not possible at the moment, but I found it to be a useful addition. However, I'm fundamentally indifferent about it. Could be a great addition to modify the save path by a custom logic.
  12. Josua Vogel uploaded patch set 5 CR +1 V +1 09/02/25, 18:35

  13. Josua Vogel uploaded patch set 6 09/02/25, 18:35

  14. Josua Vogel commented on patch set 5 09/02/25, 18:36

    Feature-107343-IntroducePSR14EventBeforeFormCreate.rst:17 Reply

    Done

    Feature-107343-IntroducePSR14EventBeforeFormCreate.rst:22 Reply

    Done

    Feature-107343-IntroducePSR14EventBeforeFormCreate.rst:26 Reply

    Done

    Feature-107343-IntroducePSR14EventBeforeFormCreate.rst:29 Reply

    Done

    BeforeFormIsCreatedEvent.php:21 Reply

    Done
  15. core-ci voted on patch set 5 V +1 09/02/25, 18:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84274

  16. core-ci voted on patch set 6 V +1 09/02/25, 18:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84275

  17. Oli Bartsch uploaded patch set 7 V +1 09/03/25, 09:19

  18. Oli Bartsch commented on patch set 7 09/03/25, 09:19

    BeforeFormIsCreatedEvent.php:33 Reply

    Done
  19. core-ci voted on patch set 7 V -1 09/03/25, 09:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84311

  20. Oli Bartsch uploaded patch set 8 V -1 09/03/25, 09:34

  21. core-ci voted on patch set 8 V +1 09/03/25, 09:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84314

  22. Oli Bartsch voted on patch set 8 CR +1 V +1 09/03/25, 09:50

  23. Benni Mack voted on patch set 8 CR +2 V +2 09/03/25, 10:07

  24. Benni Mack merged patch set 9 09/03/25, 10:07

  25. Lina Wolf commented on patch set 9 09/06/25, 11:32