Review main Merged

78000[TASK] Avoid calling ModifyLoadedPageTsConfigEvent listeners twice

Christian Kuhn CR +2 V +2 Normal +86 −15 updated 03/02/23, 19:08

Commit message

To streamline TypoScript related classes and namespaces,
patch for #99120 introduced the new event
\TYPO3\CMS\Core\TypoScript\IncludeTree\Event\ModifyLoadedPageTsConfigEvent
and dispatching it.

The old event with same signature at
\TYPO3\CMS\Core\Configuration\Event\ModifyLoadedPageTsConfigEvent
was kept, and continued to be dispatched to not introduce a breaking
change anymore. The old event was changed to *extend* the new event.

It turns out, the ListenerProvider is too clever at this point:
When an event extends another event, it finds listeners for
both events: When registering listeners for both the old and
the new event, dispatching the old event will call listeners
of the new event as well. Listeners can't distinguish this.

To prepare for easy removal in v13, we now change the old event
to no longer *extend* the new event. We continue to dispatch
both events, though. The ReST file is adapted towards a better
example on how to stay compatible in an extension and prepare
for v13 as much as possible at the same time.

Review

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

Issues 3

Files 4

Review log 68

  1. Christian Kuhn uploaded patch set 1 03/02/23, 06:02

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

  3. Christian Kuhn updated the commit message in patch set 2 V +1 03/02/23, 06:24

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

  5. Stefan Bürk voted on patch set 2 V +1 CR +1 03/02/23, 15:06

  6. Nikita Hovratov voted on patch set 2 V +1 CR +1 03/02/23, 18:51

  7. Stefan Bürk voted on patch set 2 V +2 CR +2 03/02/23, 19:08

  8. Stefan Bürk merged patch set 3 03/02/23, 19:08