91163[!!!][FEATURE] Autoconfigure backend layout data providers
Commit message
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
- typo3/sysext/backend/Classes/View/BackendLayout/DataProviderCollection.php+38 −22
- typo3/sysext/backend/Classes/View/BackendLayout/DataProviderInterface.php+18 −0
- typo3/sysext/backend/Classes/View/BackendLayout/DefaultDataProvider.php+5 −2
- typo3/sysext/backend/Classes/View/BackendLayout/PageTsBackendLayoutDataProvider.php+6 −1
- typo3/sysext/backend/Classes/View/BackendLayoutView.php+1 −10
- typo3/sysext/backend/Tests/Unit/View/BackendLayout/DataProviderCollectionTest.php+37 −39
- typo3/sysext/backend/ext_localconf.php2+0 −3
- typo3/sysext/core/Classes/Page/PageLayoutResolver.php+2 −8
- typo3/sysext/core/Documentation/Changelog/14.0/Breaking-107784-RemoveBackendLayoutDataProviderRegistrationViaGLOBALS.rstnew+84 −0
- typo3/sysext/core/Documentation/Changelog/14.0/Feature-107784-AutoconfigureBackendLayoutDataProviders.rstnew+95 −0
- typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php+6 −0
Review log 3346
Show 1621 earlier messages
-
Elias Häußler uploaded patch set 1 10/20/25, 08:16
-
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
-
Benni Mack commented on patch set 1 10/20/25, 09:23
-
Elias Häußler uploaded patch set 2
V +110/20/25, 09:34 -
Elias Häußler commented on patch set 2 10/20/25, 09:34
ext_localconf.php:25ReplyDone -
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
-
Oli Bartsch commented on patch set 2 10/20/25, 10:28
Deprecation-107784-BackendLayoutDataProviderRegistrationViaGLOBALS.rst:6Similar 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. -
Elias Häußler uploaded patch set 3
V +110/21/25, 06:24 -
Elias Häußler updated the commit message in patch set 4 10/21/25, 06:25
-
Elias Häußler commented on patch set 4 10/21/25, 06:31
Deprecation-107784-BackendLayoutDataProviderRegistrationViaGLOBALS.rst:6ReplyDone -
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
-
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
-
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'); ``` -
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`. -
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... -
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? -
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). -
Georg Ringer commented on patch set 4 10/21/25, 11:26
could you please add the old syntax to ArrayDimensionMatcher.php? thanks! -
Elias Häußler uploaded patch set 5
V +110/21/25, 12:55 -
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 😊 -
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
-
Elias Häußler uploaded patch set 6
V +110/23/25, 14:22 -
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
-
Georg Ringer voted on patch set 6 CR +1 V +1 10/23/25, 14:33
-
Elias Häußler uploaded patch set 7
CR +1V +110/24/25, 08:47 -
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. -
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
-
Elias Häußler uploaded patch set 8
V +110/24/25, 09:25 -
Elias Häußler uploaded patch set 9 10/24/25, 09:28
-
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
-
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
-
Oli Bartsch uploaded patch set 10
V +110/24/25, 10:47 -
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? -
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
-
Elias Häußler uploaded patch set 11
V +110/24/25, 16:18 -
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). -
Elias Häußler uploaded patch set 12 10/24/25, 16:21
-
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
-
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
-
Oli Bartsch uploaded patch set 13
V +111/05/25, 16:49 -
Oli Bartsch commented on patch set 13 11/05/25, 16:49
Reply
Acknowledged -
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
-
Oli Bartsch voted on patch set 13 CR +1 V +1 11/05/25, 16:57
-
Georg Ringer voted on patch set 13 CR +1 V +1 11/05/25, 20:12
-
Benni Mack voted on patch set 13 CR +2 V +2 11/05/25, 21:19
-
Benni Mack merged patch set 14 11/05/25, 21:19
ext_localconf.php:25