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

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 3

Files 4