Review main Merged Breaking

82136[!!!][FEATURE] Add PSR-14 event for modifying GetData result

Oli Bartsch CR +2 V +2 Hard +319 −11 updated 12/07/23, 14:39

Commit message

This introduces a new PSR-14 event, enabling
extension authors to modify the resolved "data",
just before `ContentObjectRenderer->getData()` is
about to return the result.

This replaces the previously available hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getData']
which is therefore now removed.

The hook required implementations to implement
the `ContentObjectGetDataHookInterface`, which
is now deprecated as it's unused due to the
hook removal.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Jochen Roth +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Jochen Roth +1
    • core-ci +1 CI

Issues 1

Files 11

Review log 1520

  1. Oli Bartsch uploaded patch set 1 12/06/23, 15:44

  2. core-ci voted on patch set 1 V +1 12/06/23, 15:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50424

  3. Oli Bartsch uploaded patch set 2 V +1 12/06/23, 15:57

  4. core-ci voted on patch set 2 V +1 12/06/23, 16:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50426

  5. Christian Kuhn commented on patch set 2 CR -1 12/07/23, 06:50

    SingletonEventDispatcher.php:26

    Imho this hack is not worth it, especially when it lives in non-testing namepace. I'm -1 to introducing this class at all: I understand you have trouble testing the event firing in tests since other events are fired around. The problem is here that you can't change COR towards DI (due to the INT handling which is hard to resolve, I just had a look at that yesterday) - DI of EventDispatcherInterface would resolve your issue ... In this case, I think we should not bow testing needs at this point: You either find a way to work around the COR issue, or this event should not be unit tested.
  6. Christian Kuhn commented on patch set 2 12/07/23, 07:00

    note we can have a chat on this today evening ;)
  7. Oli Bartsch uploaded patch set 3 CR -1 V +1 12/07/23, 08:36

  8. Oli Bartsch commented on patch set 3 12/07/23, 08:38

    SingletonEventDispatcher.php:26 Reply

    The problem was, that adding the EventDispatcherInterface as "single" instance, some tests failed, since they called the getData() multiple times. However I resolved it by adding the Interface to the container, passed to GU. Adding DI to COR will be a separate task.
  9. core-ci voted on patch set 3 V +1 12/07/23, 08:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50438

  10. Oli Bartsch commented on patch set 4 V +1 12/07/23, 10:18

    Published edit on patch set 3.
  11. core-ci voted on patch set 4 V +1 12/07/23, 10:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50441

  12. Christian Kuhn voted on patch set 4 CR +1 V +1 12/07/23, 13:32

  13. Jochen Roth commented on patch set 4 CR -1 12/07/23, 13:57

    Breaking-102614-RemovedHookForManipulatingGetDataResult.rst:45

    "returned"
  14. Jochen Roth uploaded patch set 5 CR +1 V +1 12/07/23, 14:00

  15. Jochen Roth voted on patch set 5 CR +1 V +1 12/07/23, 14:00

  16. core-ci voted on patch set 5 V +1 12/07/23, 14:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50452

  17. Christian Kuhn voted on patch set 5 CR +1 V +1 12/07/23, 14:13

  18. Christian Kuhn commented on patch set 5 12/07/23, 14:39

    Breaking-102614-RemovedHookForManipulatingGetDataResult.rst:45 Reply

    Done
  19. Christian Kuhn voted on patch set 5 CR +2 V +2 12/07/23, 14:39

  20. Christian Kuhn merged patch set 6 12/07/23, 14:39