Review main Merged Breaking

91163[!!!][FEATURE] Autoconfigure backend layout data providers

Elias Häußler CR +2 V +2 Hard +292 −85 updated 11/05/25, 21:19

Commit message

Backend layout providers are now autoconfigured in the service container
if they implement the required interface
`\TYPO3\CMS\Backend\View\BackendLayout\DataProviderInterface`. All
registered data providers are tagged as `page_layout.data_provider`
in the global service container. In order to make data providers
identifiable, a new method `getIdentifier()` must be implemented.

This approach replaces the previous registration method via
`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['BackendLayoutDataProvider']`,
which is now removed.

Developers supporting multiple TYPO3 Core versions can implement both
registration methods (via `$GLOBALS` and using autoconfiguration).

In addition, the possibility to dynamically add data providers using the
`DataProviderCollection::add()` method has been removed. Developers are
advised to register data providers in the service container.

Review

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

Issues 1

Files 11

Review log 3346

Show 1621 earlier messages
  1. Elias Häußler uploaded patch set 1 10/20/25, 08:16

  2. core-ci voted on patch set 1 V +1 10/20/25, 08:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87058

  3. Benni Mack commented on patch set 1 10/20/25, 09:23

    ext_localconf.php:25

    comment can be removed as well
  4. Elias Häußler uploaded patch set 2 V +1 10/20/25, 09:34

  5. Elias Häußler commented on patch set 2 10/20/25, 09:34

    ext_localconf.php:25 Reply

    Done
  6. core-ci voted on patch set 2 V +1 10/20/25, 09:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87064

  7. Oli Bartsch commented on patch set 2 10/20/25, 10:28

    Deprecation-107784-BackendLayoutDataProviderRegistrationViaGLOBALS.rst:6

    Similar to replacing hooks with events, let's make this breaking. This way people can support multiple versions with the same code because they can have both the hook and the event in their code base while the hook is not used in v14 anymore and the event is not dispatched in v13.
  8. Elias Häußler uploaded patch set 3 V +1 10/21/25, 06:24

  9. Elias Häußler updated the commit message in patch set 4 10/21/25, 06:25

  10. Elias Häußler commented on patch set 4 10/21/25, 06:31

    Deprecation-107784-BackendLayoutDataProviderRegistrationViaGLOBALS.rst:6 Reply

    Done
  11. core-ci voted on patch set 3 V +1 10/21/25, 06:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87136

  12. core-ci voted on patch set 4 V +1 10/21/25, 06:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87137

  13. Oli Bartsch commented on patch set 4 10/21/25, 07:47

    Just checked this again. While I generally would like to use PHP Attributes for auto-configuration whenever possible, in this case, I think introducing an attribute is not necessary because the providers need to implement the interface anyways. This can also be used to autotag those services. ``` $containerBuilder->registerForAutoconfiguration(DataProviderInterface::class)->addTag('backend.layout.data_provider'); ```
  14. Elias Häußler commented on patch set 4 10/21/25, 07:52

    Reply

    That's normally true, but in this case, we'd lose the identifier, unless we enforce this via the interface using some method like `public static function getIdentifier(): string`.
  15. Elias Häußler commented on patch set 4 10/21/25, 08:58

    Reply

    We could also just do it as ```php #[AutoconfigureTag('backend.layout.data_provider', ['identifier' => 'my_provider'])] ``` for each provider. But this is less convenient than a custom attribute. OTOH, we do this for content objects as well...
  16. Oli Bartsch commented on patch set 4 10/21/25, 10:48

    Reply

    What is the identifier for? Can we not just use the service name as identifier?
  17. Elias Häußler commented on patch set 4 10/21/25, 11:13

    Reply

    It is used to identify the provider responsible for a specific backend layout, e.g. `pagets__home` resolves to `PageTsBackendLayoutProvider` (identified by `pagets`, which is currently part of the new attribute).
  18. Georg Ringer commented on patch set 4 10/21/25, 11:26

    could you please add the old syntax to ArrayDimensionMatcher.php? thanks!
  19. Elias Häußler uploaded patch set 5 V +1 10/21/25, 12:55

  20. Elias Häußler commented on patch set 5 10/21/25, 12:56

    Reply

    Thanks for the hint, I wasn't aware of this file 😊
  21. core-ci voted on patch set 5 V +1 10/21/25, 13:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87187

  1. Elias Häußler uploaded patch set 6 V +1 10/23/25, 14:22

  2. core-ci voted on patch set 6 V +1 10/23/25, 14:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87432

  3. Georg Ringer voted on patch set 6 CR +1 V +1 10/23/25, 14:33

  4. Elias Häußler uploaded patch set 7 CR +1 V +1 10/24/25, 08:47

  5. Elias Häußler commented on patch set 7 10/24/25, 08:48

    Reply

    I cleaned this up a little bit and dropped the new attribute in favor of an autoconfigured-based approach in combination with a new static method `getIdentfier()`. This way, the only change which needs to be done is implementing this new static method. Everything else is done by autoconfiguration in the service container.
  6. core-ci voted on patch set 7 V +1 10/24/25, 08:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87475

  7. Elias Häußler uploaded patch set 8 V +1 10/24/25, 09:25

  8. Elias Häußler uploaded patch set 9 10/24/25, 09:28

  9. core-ci voted on patch set 8 V -1 10/24/25, 09:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87479

  10. core-ci voted on patch set 9 V +1 10/24/25, 09:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87480

  11. Oli Bartsch uploaded patch set 10 V +1 10/24/25, 10:47

  12. Oli Bartsch commented on patch set 9 10/24/25, 10:48

    Reply

    I think this is a good solution now. However, can we get rid of the `add` method?
  13. core-ci voted on patch set 10 V +1 10/24/25, 10:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87487

  14. Elias Häußler uploaded patch set 11 V +1 10/24/25, 16:18

  15. Elias Häußler commented on patch set 11 10/24/25, 16:20

    Reply

    Done. I kept two validation steps which were previously located in the `add` method, as I think these are still required (especially the one that validates the identifier).
  16. Elias Häußler uploaded patch set 12 10/24/25, 16:21

  17. core-ci voted on patch set 11 V +1 10/24/25, 16:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87523

  18. core-ci voted on patch set 12 V +1 10/24/25, 16:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87524

  19. Oli Bartsch uploaded patch set 13 V +1 11/05/25, 16:49

  20. Oli Bartsch commented on patch set 13 11/05/25, 16:49

    Reply

    Acknowledged
  21. core-ci voted on patch set 13 V +1 11/05/25, 16:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88534

  22. Oli Bartsch voted on patch set 13 CR +1 V +1 11/05/25, 16:57

  23. Georg Ringer voted on patch set 13 CR +1 V +1 11/05/25, 20:12

  24. Benni Mack voted on patch set 13 CR +2 V +2 11/05/25, 21:19

  25. Benni Mack merged patch set 14 11/05/25, 21:19