Skip to content
Snippets Groups Projects
Commit df1fda4e authored by Christian Kuhn's avatar Christian Kuhn Committed by Stefan Bürk
Browse files

[TASK] Avoid calling ModifyLoadedPageTsConfigEvent listeners twice

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.

Resolves: #100060
Related: #97816
Related: #99120
Change-Id: If5813ce2110de6078de33fa84ade57e852985266
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78000


Tested-by: default avatarNikita Hovratov <nikita.h@live.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarNikita Hovratov <nikita.h@live.de>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
parent 05a80d8c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment