Review main Merged

89941[FEATURE] Add event to change the record data in list view

Simon Schaufelberger CR +2 V +2 Hard +337 −6 updated 02/20/26, 22:04

Commit message

A new event has been added to change the record data in the
list view.

Caution: Even though it is discouraged to hand in the
"parent object" (in this case DatabaseRecordList) the current
implementation encourages this as an exception.

Why? DatabaseRecordList is still full with public properties
that are needed from the outside, and also couples the
rendering, which should be changed at a later point,
making this Event "obsolete" as well.

Review

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

Issues 2

Files 5

Review log 5469

Show 3544 earlier messages
  1. Simon Schaufelberger uploaded patch set 1 06/29/25, 18:32

  2. core-ci voted on patch set 1 V +1 06/29/25, 18:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81115

  3. Simon Schaufelberger uploaded patch set 2 V +1 06/29/25, 18:55

  4. Simon Schaufelberger uploaded patch set 3 06/29/25, 18:57

  5. core-ci voted on patch set 3 V +1 06/29/25, 19:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81117

  6. core-ci voted on patch set 2 V +1 06/29/25, 19:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81116

  7. Georg Ringer commented on patch set 3 CR -1 06/30/25, 08:30

    ModifyRecordListRecordTitleEvent.php:57

    I suggest removing that, not a real todo what will change TBH

    Feature-107003-AddEventToChangeTitleLinkInListView.rst:23

    see e.g. 99409, instead of services.yaml we now use #[AsEventListener
  8. Simon Schaufelberger commented on patch set 3 06/30/25, 09:13

    ModifyRecordListRecordTitleEvent.php:57 Reply

    I have inspired myself from the ModifyRecordListTableActionsEvent where there is also the TODO. what do you think?
  9. Georg Ringer commented on patch set 3 06/30/25, 12:34

    ModifyRecordListRecordTitleEvent.php:57 Reply

    won't give a -1 for that one, there is no right or wrong IMHO
  10. Simon Schaufelberger uploaded patch set 4 CR -1 V +1 06/30/25, 16:46

  11. Simon Schaufelberger commented on patch set 4 06/30/25, 16:46

    Feature-107003-AddEventToChangeTitleLinkInListView.rst:23 Reply

    Done
  12. Simon Schaufelberger commented on patch set 4 06/30/25, 16:46

    ModifyRecordListRecordTitleEvent.php:57 Reply

    Acknowledged
  13. core-ci voted on patch set 4 V +1 06/30/25, 16:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81146

  14. Georg Ringer voted on patch set 4 CR +1 V +1 06/30/25, 17:32

  15. Garvin Hicking commented on patch set 4 06/30/25, 18:37

    Feature-107003-AddEventToChangeTitleLinkInListView.rst:33

    Is this really any kind of raw HTML? If so, this variable name might need to reflect that. otherwise I would supply a link to it like "https://example.com/xyz"; and wouldn't think I need to add the whole HTML construct. Also this might lead people into injecting any kind of HTML here so maybe instead we should really only allow links and build the HTML outside?
  16. Simon Schaufelberger commented on patch set 4 06/30/25, 18:48

    Feature-107003-AddEventToChangeTitleLinkInListView.rst:33 Reply

    This event works exactly the same like the ModifyRecordListTableActionsEvent where you also have to pass a new link like this: ``` $iconIdentifier = 'actions-open'; $editLink = $this->uriBuilder->buildUriFromRoute('web_layout', $parameters); $editAction = '<a class="btn btn-default" href="' . htmlspecialchars((string) $editLink) . '"' . ' title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:edit')) . '">' . $this->iconFactory->getIcon($iconIdentifier, IconSize::SMALL)->render() . '</a>'; $event->setAction($editAction, 'edit', 'primary'); ```
  17. Simon Schaufelberger commented on patch set 4 06/30/25, 18:52

    Feature-107003-AddEventToChangeTitleLinkInListView.rst:33 Reply

    or should I also name the property "action"?
  18. Garvin Hicking commented on patch set 4 07/01/25, 12:36

    Feature-107003-AddEventToChangeTitleLinkInListView.rst:33 Reply

    That would help me as a reader to understand that it's not just a URL, but a whole HTML tag. Could you maybe describe your use case for adjusting the link? The TCA title/label userfunc adjusts the title, but I wonder which kind of link adjustment you do. My question aims towards that firing this event might have some performance implications, and I wonder if instead me might want to have some other kind of integration here. I guess the "proper" goal could be to make the whole output templateable, and other place at some point may also want to be changed (like custom warnings - and all the actions for controls, translations etc. might also want to be customized). So I wonder if we should just throw events at this or look at the bigger picture. I'm not blocking this, but personally I'm afraid this change might have a too narrowly set focus.
  19. Simon Schaufelberger commented on patch set 4 07/01/25, 13:33

    Feature-107003-AddEventToChangeTitleLinkInListView.rst:33 Reply

    My usecase is the following: I'm using https://docs.typo3.org/p/georgringer/news/12.3/en-us/Addons/NewsContentElements/Index.html which provides a standard page module to edit content elements within a news record. Instead of clicking through the news record -> Content Elements -> Link to Page module, I want to directly link to the "news page module" from the TYPO3 List module. Currently this only works for the edit button but not for the title link. I'm open for a better solution and I guess Georg can also help here as he created the extension ;)
  20. Oli Bartsch commented on patch set 4 07/02/25, 11:30

    On the first look, this seems like a limitation of the `clickTitleMode` TSconfig option. What do you think about adding it to this API instead?
  21. Oli Bartsch commented on patch set 4 07/02/25, 11:32

    ModifyRecordListRecordTitleLinkEvent.php:59

    Actually, we’ve decided not to include entire instances in events anymore (as was previously done for hooks). Which specific information is actually needed for the use cases? Let’s identify and add only those.
  22. Simon Schaufelberger commented on patch set 4 07/02/25, 12:01

    Reply

    From my understanding clickTitleMode would be applied to all records, or? I only want it for news records. Additionally, I need to be able to define my own link which will become difficult with this option. what do you think?

    ModifyRecordListRecordTitleLinkEvent.php:59 Reply

    I personally don't need it. I just copied it over from ModifyRecordListTableActionsEvent. I'm fine dropping it.
  23. Simon Schaufelberger commented on patch set 4 07/02/25, 12:07

    ModifyRecordListRecordTitleLinkEvent.php:59 Reply

    No, sorry, I would actually need it for: `'returnUrl' => $event->getRecordList()->listURL(),`
  24. Simon Schaufelberger uploaded patch set 5 CR +1 V +1 08/07/25, 18:59

  25. core-ci voted on patch set 5 V +1 08/07/25, 19:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82875

  26. Simon Schaufelberger uploaded patch set 6 V +1 08/07/25, 19:57

  27. Simon Schaufelberger uploaded patch set 7 08/07/25, 20:00

  28. Georg Ringer commented on patch set 7 CR +1 V +1 08/07/25, 20:01

    ModifyRecordListRecordTitleLinkEvent.php:59 Reply

    as DatabaseRecordList is currently still a bit a mess and having access to it is really helpful/needed and because the event is in sync with the other events I opt for having that in there

    Feature-107003-AddEventToChangeTitleLinkInListView.rst:33 Reply

    Done
  29. core-ci voted on patch set 6 V +1 08/07/25, 20:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82904

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

  31. Oli Bartsch commented on patch set 7 CR -1 08/07/25, 20:42

    Reply

    Oke seems valid.

    DatabaseRecordList.php:2768

    Please don't pass the whole class to the event. We tried to avoid this when migrating from hooks to events. So only add context, which is really needed. Otherwise we make make internal API public.
  32. Simon Schaufelberger commented on patch set 7 08/07/25, 23:24

    DatabaseRecordList.php:2768 Reply

    this IS currently already happening in ModifyRecordListTableActionsEvent. the new Event is in sync with the other one and I need an API to get the link back to the list module
  33. Simon Schaufelberger commented on patch set 7 08/07/25, 23:27

    DatabaseRecordList.php:2768 Reply

    as you can see,the other event was also not well designed from the beginning. any suggestions?
  34. Simon Schaufelberger uploaded patch set 8 CR +1 V +1 08/08/25, 11:46

  35. core-ci voted on patch set 8 V +1 08/08/25, 11:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83011

  36. Benni Mack commented on patch set 8 08/08/25, 16:56

    DatabaseRecordList.php:2768 Reply

    Let's place the new event at a place that supersedes the existing ModifyRecordListTableActionsEvent and also allows to do much more than this current proposal.
  37. Simon Schaufelberger commented on patch set 8 08/09/25, 22:48

    DatabaseRecordList.php:2768 Reply

    @benni@typo3.org Can you please specify what I should do?
  38. Benni Mack commented on patch set 8 08/29/25, 14:45

    DatabaseRecordList.php:2768 Reply

    Here is the guide to this: 1. Let's migrate to Record API https://review.typo3.org/c/Packages/TYPO3.CMS/+/90405 2. Introduce Objects for the LinkActions see https://review.typo3.org/c/Packages/TYPO3.CMS/+/90383 3. We introduce a new PSR-14 event (= this change) that receives a LinkAction which can then be overridden.
  39. Simon Schaufelberger commented on patch set 8 11/20/25, 10:21

    DatabaseRecordList.php:2768 Reply

    @benni@typo3.org Since the second point got abandoned, can we move forward here somehow?
  40. Oli Bartsch commented on patch set 8 11/20/25, 10:26

    DatabaseRecordList.php:2768 Reply

    I think this was done with https://review.typo3.org/c/Packages/TYPO3.CMS/+/91288 instead.
  41. Simon Schaufelberger commented on patch set 8 12/18/25, 21:12

    DatabaseRecordList.php:2768 Reply

    @benni@typo3.org I would like to bring this into v14 so I can use the event it in my extension. Can you please let me know if I should wait for some bigger refactoring or if I should adjust something to make it ready to be merged?
  42. Benni Mack commented on patch set 8 CR -1 12/19/25, 08:04

    DatabaseRecordList.php:2768 Reply

    Hey. with all the pre-work now in place, this patch can now move on. That said: I suggest adding an Event in renderListRow() just before addData() so it is possible to manipulate all cells of a row, and not just the title.
  43. Simon Schaufelberger uploaded patch set 9 CR -1 V +1 12/21/25, 22:34

  44. core-ci voted on patch set 9 V +1 12/21/25, 22:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/92560

  1. Simon Schaufelberger commented on patch set 9 12/21/25, 22:46

    DatabaseRecordList.php:2768 Reply

    I implemented a completely new version of the event now and I'm open for feedback. One thing I didn't like is that there is no full record row entry available where everything is inside, that is why I'm passing the title separately, otherwise the user would need to fetch it again which doubles the sql queries. The same with the lockInfo. In my opinion this should not be part of the title.
  2. Simon Schaufelberger uploaded patch set 10 V +1 01/23/26, 12:43

  3. Simon Schaufelberger commented on patch set 10 01/23/26, 12:46

    DatabaseRecordList.php:2768 Reply

    @benni@typo3.org can you please have a look at this patch now? the new event is also covered with a test.
  4. core-ci voted on patch set 10 V +1 01/23/26, 12:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94170

  5. Benni Mack commented on patch set 10 02/07/26, 11:54

    DatabaseRecordList.php:2768 Reply

    Patch looks fine. IMHO I think we could hand over the DatabaseRecordList object completely instead of the one public property you currently need.
  6. Benni Mack uploaded patch set 11 V +1 02/08/26, 09:34

  7. Benni Mack commented on patch set 11 02/08/26, 09:35

    DatabaseRecordList.php:2768 Reply

    Hey Oli, I think in this case, the whole class with so many public properties is indeed much more useful than in the other cases. IMHO this patch is now ready for me now.
  8. core-ci voted on patch set 11 V +1 02/08/26, 09:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95401

  9. Benni Mack rebased onto patch set 12 V +1 02/18/26, 14:42

  10. core-ci voted on patch set 12 V +1 02/18/26, 14:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96154

  11. Oli Bartsch commented on patch set 12 02/18/26, 15:08

    DatabaseRecordList.php:2768 Reply

    Yes fine for me.
  12. Oli Bartsch commented on patch set 12 02/18/26, 15:12

    AfterRecordListRowPreparedEvent.php:58

    Should be `?string`. Interesting phpstan does not report this.

    Feature-107003-AddEventToChangeRecordDataInListView.rst:17

    it also allows to change tag attributes. Maybe just list all methods with poroper description here.
  13. Simon Schaufelberger uploaded patch set 13 V +1 02/18/26, 16:18

  14. Simon Schaufelberger commented on patch set 12 02/18/26, 16:19

    AfterRecordListRowPreparedEvent.php:58 Reply

    That is only detected with level 8.

    Feature-107003-AddEventToChangeRecordDataInListView.rst:17 Reply

    ok or too many details?
  15. Simon Schaufelberger commented on patch set 13 02/18/26, 16:21

    AfterRecordListRowPreparedEvent.php:58 Reply

    we are on level 5 only.
  16. Simon Schaufelberger uploaded patch set 14 02/18/26, 16:41

  17. core-ci voted on patch set 14 V +1 02/18/26, 16:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96175

  18. core-ci voted on patch set 13 V +1 02/18/26, 16:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96170

  19. Garvin Hicking commented on patch set 14 CR +1 V +1 02/20/26, 21:37

    Feature-107003-AddEventToChangeRecordDataInListView.rst:17 Reply

    Let's keep it like that. The "data" array is so obfuscated, everyone will most likely just xdebug/print_r inspect it, and not look here in the docs.
  20. Benni Mack updated the commit message in patch set 15 CR +1 V +1 02/20/26, 21:51

  21. Simon Schaufelberger commented on patch set 15 02/20/26, 21:57

    Feature-107003-AddEventToChangeRecordDataInListView.rst:17 Reply

    Chances are low that somebody will actually use this event except me 😄 I just want to link to some other module
  22. Garvin Hicking commented on patch set 15 CR +1 V +1 02/20/26, 22:01

    Feature-107003-AddEventToChangeRecordDataInListView.rst:17 Reply

    Psssh, don't hint other people at that we're doing this JUST FOR YOU
  23. core-ci voted on patch set 15 V +1 02/20/26, 22:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96410

  24. Benni Mack voted on patch set 15 CR +2 V +2 02/20/26, 22:04

  25. Benni Mack merged patch set 16 02/20/26, 22:04