Review main Merged

96125[FEATURE] Add PSR-14 event after a record is rendered

Oli Bartsch CR +2 V +2 Hard +351 −3 updated 10/01/26, 08:32

Commit message

The CONTENT and RECORDS content objects now dispatch the new
AfterRecordIsRenderedEvent after each record has been rendered.
Listeners can modify the rendered content, for example to wrap it
in additional markup.

It is the counterpart to ModifyRenderedRecordEvent of the
f:render.record and f:render.contentArea ViewHelpers, so records
rendered the classic way, e.g. via styles.content.get, can be
processed as well.

The event name follows AfterLinkIsGeneratedEvent, which also allows
to modify its result. ModifyRenderedRecordEvent is already taken by
EXT:fluid, and reusing the short name would force aliased imports
for listeners handling both events.

Review

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

Issues 1

Files 7

Review log 2232

Show 47 earlier messages
  1. Oli Bartsch uploaded patch set 1 09/28/26, 12:19

  2. core-ci voted on patch set 1 V +1 09/28/26, 12:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109419

  3. Oli Bartsch updated the commit message in patch set 2 V +1 09/28/26, 12:41

  4. core-ci voted on patch set 2 V +1 09/28/26, 12:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109420

  5. Josua Vogel voted on patch set 2 CR +1 09/28/26, 14:39

  6. Oli Bartsch rebased onto patch set 3 CR +1 V +1 09/28/26, 21:03

  7. core-ci voted on patch set 3 V -1 09/28/26, 21:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109458

  1. Oli Bartsch rebased onto patch set 4 V -1 09/28/26, 21:25

  2. core-ci voted on patch set 4 V +1 09/28/26, 21:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109464

  3. Oli Bartsch uploaded patch set 5 09/28/26, 21:51

    Copied Votes: * Verified+1 (copy condition: "**changekind:NO_CHANGE**")
  4. Georg Ringer voted on patch set 5 CR +1 V +1 09/28/26, 21:55

  5. core-ci voted on patch set 5 V +1 09/28/26, 22:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109466

  6. Josua Vogel voted on patch set 5 CR +1 V +1 09/29/26, 05:02

  7. Benni Mack commented on patch set 5 CR -1 09/29/26, 05:18

    how would we ensure that this also applies to content that is generated via FLUID? Couldn't we apply this to a Record object or the original array instead, so we don't have to deal with one huge string of content, but with the actual fields?

    AfterRecordIsRenderedEvent.php:32

    we could hand in a Record object?
  8. Oli Bartsch uploaded patch set 6 CR +1 V +1 09/29/26, 07:03

  9. Oli Bartsch commented on patch set 6 09/29/26, 07:07

    Reply

    I don't quite get what you mean by generated via Fluid. Fluid rendering via f:render.record / f:render.contentArea is covered by ModifyRenderedRecordEvent (the related workspace patch listens to both). This event just closes the gap for CONTENT/RECORDS. Records printed inline in templates have no render boundary, so no event can cover them. Field-level processing doesn't work for the marker use case, since we need to know where a record's output starts and ends, and values injected into fields get escaped/cropped/parsed.

    AfterRecordIsRenderedEvent.php:32 Reply

    Done. getRecord() now returns a RecordInterface, like ModifyRenderedRecordEvent. It is resolved on first access, so rows no listener asks for cost nothing. It can't be created eagerly: RecordFactory throws for rows without the type field, e.g. CONTENT with a custom select.selectFields = uid, header, and that would break existing TypoScript. So getRecord() is nullable and never throws, and the raw row is still there via getRow(), including workspace / language overlay fields.
  10. core-ci voted on patch set 6 V +1 09/29/26, 07:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109483

  11. Benni Mack commented on patch set 6 09/30/26, 21:39

    Reply

    ModifyRenderedRecordEvent works

    AfterRecordIsRenderedEvent.php:32 Reply

    sounds good. Should we also add a request, or something like this? Or lets put it the other way: Do we need cObj, or could we instead hand over "request"?
  12. Oli Bartsch uploaded patch set 7 V +1 09/30/26, 21:51

  13. Oli Bartsch commented on patch set 7 09/30/26, 21:52

    AfterRecordIsRenderedEvent.php:32 Reply

    Done
  14. core-ci voted on patch set 7 V -1 09/30/26, 22:07 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109725

  15. Oli Bartsch rebased onto patch set 8 V -1 10/01/26, 06:00

  16. core-ci voted on patch set 8 V +1 10/01/26, 06:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109747

  17. Oli Bartsch uploaded patch set 9 V +1 10/01/26, 07:55

  18. Benni Mack voted on patch set 9 CR +1 V +1 10/01/26, 07:59

  19. core-ci voted on patch set 9 V -1 10/01/26, 08:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109762

  20. Oli Bartsch uploaded patch set 10 CR +1 V +1 10/01/26, 08:20

  21. Benni Mack voted on patch set 10 CR +1 V +1 10/01/26, 08:24

  22. Josua Vogel voted on patch set 10 CR +1 V +1 10/01/26, 08:25

  23. core-ci voted on patch set 10 V +1 10/01/26, 08:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109767

  24. Oli Bartsch voted on patch set 10 CR +2 V +2 10/01/26, 08:32

  25. Oli Bartsch merged patch set 11 10/01/26, 08:32