Review main Merged Breaking

86036[!!!][FEATURE] Add TypolinkBuilderInterface with automatic DI

Benni Mack CR +2 V +2 Expert +749 −329 updated 09/02/25, 13:53

Commit message

Introduces a new TypolinkBuilderInterface to replace the previous
AbstractTypolinkBuilder approach, enabling proper dependency injection
for TypolinkBuilder implementations.

Key changes:
* New TypolinkBuilderInterface with buildLink() method
* All core TypolinkBuilder implementations now use DI
* Automatic DI configuration for all interface implementations
* AbstractTypolinkBuilder constructor removed (breaking)
* build() method deprecated in favor of buildLink()

All implementations of TypolinkBuilderInterface are automatically
configured as public services via DI container autoconfiguration,
eliminating the need for manual service configuration.

The new buildLink() method provides request context directly
and supports proper dependency injection patterns.

Breaking changes:
* AbstractTypolinkBuilder constructor signature changed
* Method signatures changed from build() to buildLink()
* Custom implementations must implement the new interface

Deprecations:
* AbstractTypolinkBuilder->build() method
* AbstractTypolinkBuilder->$contentObjectRenderer property

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Stefan Bürk +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 24

Show 4 more files

Review log 3661

Show 2036 earlier messages
  1. Benni Mack uploaded patch set 1 09/11/24, 21:57

  2. core-ci voted on patch set 1 V -1 09/11/24, 22:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65503

  3. Benni Mack uploaded patch set 2 V -1 09/12/24, 08:04

  4. core-ci voted on patch set 2 V -1 09/12/24, 08:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65534

  5. core-ci commented on patch set 2 09/12/24, 08:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65534

  6. Benni Mack uploaded patch set 3 V -1 09/12/24, 08:44

  7. core-ci voted on patch set 3 V -1 09/12/24, 08:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65544

  8. Benni Mack uploaded patch set 4 V -1 09/12/24, 10:08

  9. core-ci voted on patch set 4 V -1 09/12/24, 10:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65551

  10. Benni Mack marked it work in progress 01/22/25, 11:50

  11. Benni Mack rebased onto patch set 5 V -1 03/10/25, 14:52

  12. core-ci voted on patch set 5 V -1 03/10/25, 15:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75422

  13. Benni Mack rebased onto patch set 6 V -1 03/19/25, 16:03

  14. core-ci voted on patch set 6 V -1 03/19/25, 16:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75847

  15. Benni Mack uploaded patch set 7 V -1 03/20/25, 13:22

  16. core-ci voted on patch set 7 V +1 03/20/25, 13:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75893

  17. Benni Mack uploaded patch set 8 V +1 03/20/25, 21:39

  18. core-ci voted on patch set 8 V -1 03/20/25, 21:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75913

  19. Benni Mack updated the commit message in patch set 9 V -1 03/21/25, 08:21

  20. core-ci voted on patch set 9 V -1 03/21/25, 08:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75947

  21. Benni Mack uploaded patch set 10 V -1 03/21/25, 08:39

  22. core-ci voted on patch set 10 V +1 03/21/25, 08:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75948

  23. Benni Mack uploaded patch set 11 V +1 03/22/25, 20:37

  24. Benni Mack marked it ready for review 03/22/25, 20:39

  25. core-ci voted on patch set 11 V +1 03/22/25, 20:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76045

  26. Garvin Hicking commented on patch set 11 03/23/25, 09:03

    Deprecation-106405-AbstractTypolinkBuilder-build.rst:47

    ```suggestion in PHP code. ```

    Deprecation-106405-AbstractTypolinkBuilder-build.rst:49

    ```suggestion If extension authors have created custom classes extended from AbstractLinkBuilder, ```

    Deprecation-106405-AbstractTypolinkBuilder-build.rst:50

    ```suggestion it is recommended to implement the new Interface, so the deprecation message ```
  27. Benni Mack uploaded patch set 12 V +1 03/23/25, 10:44

  28. Benni Mack commented on patch set 11 03/23/25, 10:44

    Deprecation-106405-AbstractTypolinkBuilder-build.rst:47 Reply

    Done

    Deprecation-106405-AbstractTypolinkBuilder-build.rst:49 Reply

    Done

    Deprecation-106405-AbstractTypolinkBuilder-build.rst:50 Reply

    Done
  29. core-ci voted on patch set 12 V +1 03/23/25, 10:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76065

  30. Simon Schaufelberger voted on patch set 12 CR +1 03/23/25, 19:22

  31. Benni Mack rebased onto patch set 13 CR +1 V +1 03/27/25, 14:00

  32. core-ci voted on patch set 13 V +1 03/27/25, 14:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76464

  33. Benni Mack rebased onto patch set 14 V +1 07/25/25, 19:35

  34. core-ci voted on patch set 14 V +1 07/25/25, 19:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82333

  35. Benni Mack rebased onto patch set 15 V +1 08/14/25, 09:44

  36. core-ci voted on patch set 15 V +1 08/14/25, 09:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83369

  1. Benni Mack uploaded patch set 16 V +1 09/01/25, 17:18

  2. core-ci voted on patch set 16 V -1 09/01/25, 17:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84180

  3. Benni Mack uploaded patch set 17 V -1 09/01/25, 18:23

  4. core-ci voted on patch set 17 V -1 09/01/25, 18:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84182

  5. Benni Mack uploaded patch set 18 V -1 09/01/25, 19:42

  6. core-ci voted on patch set 18 V -1 09/01/25, 19:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84186

  7. Benni Mack uploaded patch set 19 V -1 09/01/25, 20:04

  8. core-ci voted on patch set 19 V +1 09/01/25, 20:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84188

  9. Benni Mack uploaded patch set 20 V +1 09/01/25, 20:35

  10. core-ci voted on patch set 20 V +1 09/01/25, 20:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84190

  11. Benni Mack rebased onto patch set 21 V +1 09/02/25, 09:19

  12. Stefan Bürk commented on patch set 20 09/02/25, 09:20

    AbstractTypolinkBuilder.php:30

    Not directly passed, only within the passed ServerRequestInterface - or am I wrong ?

    LinkFactory.php:156

    `AbstractTypolinkBuilder->_build()` checks for `buildLink()` method avoiding the deprecation there, which I'd say would be a path for extension developers to provide dual core version support and what is tried to provide as layer. This deprecation here still does not allow to make a dual core version compat without deprecations .. at least not with the "thought" mitigation provided by core and extension developers wanting a deprecation free dual core version support requires quite extensive class and class_alias shizzling just to avoid this deprecation here. Intented ? Or should we triger this only if no `buildLink()` method exists ? ``` // For people already migrating in v13, adding the method but not the // interface, this works as well :) if (method_exists($this, 'buildLink')) { return $this->buildLink($linkDetails, $conf, $request, $linkText); } ```

    PageLinkBuilder.php:81

    No implicit handing in case `currentContentObject` is not set in the request. Should we guard that and throw a concrete/runTime exception with a meaningfull message ? Secondly, do we really need to reintroduce the $contentObjectRnder property here (deprecated in AbstractTypolinkBuilder) ? I guess passing it arround would be a more better approach ... or is this planned as a after/followup ?
  13. core-ci voted on patch set 21 V +1 09/02/25, 09:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84224

  14. Benni Mack uploaded patch set 22 V +1 09/02/25, 09:57

  15. Benni Mack commented on patch set 21 09/02/25, 09:58

    AbstractTypolinkBuilder.php:30 Reply

    Fixed

    LinkFactory.php:156 Reply

    I changed this now

    PageLinkBuilder.php:81 Reply

    I added a fallback now. For the time being, we need cObj due to excessive use of stdWrap. This can be thinned out more and more, but as this patch has been stuck for almost a year, and I do not want to make this change even bigger again, I think this can be handled separately.
  16. core-ci voted on patch set 22 V +1 09/02/25, 10:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84228

  17. Stefan Bürk commented on patch set 22 09/02/25, 11:15

    Breaking-106405-TypolinkBuilderSignatureChanges.rst:111

    `FullyScanned` .. cannot see any extension scanner additions in this change, do I miss something ?

    PageLinkBuilder.php:81 Reply

    Thinking the same. Ack on reworking int within the smaller/internal scope lateron.
  18. Benni Mack commented on patch set 23 V +1 09/02/25, 12:00

    Published edit on patch set 22.
  19. Benni Mack commented on patch set 24 09/02/25, 12:00

    Published edit on patch set 23.
  20. Benni Mack commented on patch set 24 09/02/25, 12:00

    Breaking-106405-TypolinkBuilderSignatureChanges.rst:111 Reply

    Done
  21. core-ci voted on patch set 24 V +1 09/02/25, 12:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84243

  22. core-ci voted on patch set 23 V +1 09/02/25, 12:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84242

  23. Stefan Bürk voted on patch set 24 CR +1 V +1 09/02/25, 13:45

  24. Georg Ringer voted on patch set 24 CR +2 V +2 09/02/25, 13:53

  25. Georg Ringer merged patch set 25 09/02/25, 13:53