Review main Merged

91027[FEATURE] Add PSR-14 for record retrieval in DatabaseRecordLinkBuilder

Francois Suter CR +2 V +2 Hard +330 −23 updated 10/27/25, 16:59

Commit message

A new PSR-14 event TYPO3\CMS\Frontend\Event\BeforeDatabaseRecordLinkResolvedEvent
is introduced. The event is dispatched right before the
database record lookup for a link is done in the
DatabaseRecordLinkBuilder and therefore allows
custom functionality to retreive a record.

The event is stoppable, which means that as soon
as a listener returns a record, no further listener
gets called and the core does not further lookup.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Benni Mack +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Benni Mack +1

Issues 1

Files 5

Review log 2332

Show 57 earlier messages
  1. Francois Suter uploaded patch set 1 10/13/25, 11:14

  2. core-ci voted on patch set 1 V -1 10/13/25, 11:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86537

  3. Francois Suter uploaded patch set 2 V -1 10/13/25, 14:12

  4. core-ci voted on patch set 2 V +1 10/13/25, 14:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86547

  5. Benni Mack commented on patch set 2 10/13/25, 14:50

    DatabaseRecordLinkBuilder.php:78

    we can move the default logic into a custom method.
  6. Francois Suter commented on patch set 2 10/13/25, 14:55

    Thanks for the quick feedback. Will refactor.

    DatabaseRecordLinkBuilder.php:78 Reply

    Acknowledged
  7. Stefan Bürk commented on patch set 2 10/13/25, 15:22

    Sorry, in the current form this does not make any sense ... the event does not hold any context for a event listener to return a "meaningfull" record. Based on what should the event listener now which record to return and for which id ? Even moving the record retrival into a dedicated method and dispatching the event there needs to provide proper context, otherwise the whole event is use-less. Or do I miss something ? To precise .. how should a event listener knwo to return for example `tx_news_domain_model_news UID: 1234` as record or `page UID: 987`. At least table name and linkDetails UID needs to be passed, if not $linkDetails or even more the whole $linkHandlerConfiguration.
  1. Francois Suter commented on patch set 2 10/13/25, 19:45

    Reply

    Doh, I feel absolutely silly. There was indeed a little voice nagging at me, saying that the event class looked ridiculously naked, but I must have been very distracted. I'll fix that of course!
  2. Francois Suter uploaded patch set 3 V +1 10/14/25, 06:41

  3. Francois Suter commented on patch set 3 10/14/25, 06:43

    Reply

    Done
  4. core-ci voted on patch set 3 V -1 10/14/25, 06:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86599

  5. Francois Suter uploaded patch set 4 V -1 10/14/25, 06:56

  6. core-ci voted on patch set 4 V +1 10/14/25, 07:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86600

  7. Francois Suter uploaded patch set 5 V +1 10/27/25, 09:42

  8. core-ci voted on patch set 5 V -1 10/27/25, 09:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87629

  9. Oli Bartsch uploaded patch set 6 V -1 10/27/25, 11:36

  10. core-ci voted on patch set 6 V -1 10/27/25, 11:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87639

  11. Oli Bartsch uploaded patch set 7 V -1 10/27/25, 11:47

  12. core-ci voted on patch set 7 V +1 10/27/25, 11:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87640

  13. Oli Bartsch voted on patch set 7 CR +2 V +2 10/27/25, 12:01

  14. Oli Bartsch voted on patch set 7 CR +1 V +1 10/27/25, 12:38

  15. Benni Mack commented on patch set 7 10/27/25, 15:08

    DatabaseRecordLinkBuilder.php:79

    we need the request object here as well.
  16. Francois Suter uploaded patch set 8 CR +1 V +1 10/27/25, 15:55

  17. Francois Suter commented on patch set 8 10/27/25, 15:55

    DatabaseRecordLinkBuilder.php:79 Reply

    Added in the new patchset
  18. core-ci voted on patch set 8 V +1 10/27/25, 16:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87676

  19. Jochen Roth commented on patch set 8 10/27/25, 16:37

    > done
  20. Benni Mack updated the commit message in patch set 9 V +1 10/27/25, 16:45

  21. Benni Mack commented on patch set 9 10/27/25, 16:46

    Reply

    Done
  22. Benni Mack voted on patch set 9 CR +1 V +1 10/27/25, 16:46

  23. Oli Bartsch voted on patch set 9 CR +2 V +2 10/27/25, 16:48

  24. Oli Bartsch merged patch set 10 10/27/25, 16:48

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