Breaking: #102715 - Frontend "determineId()" related events changed¶
See forge#102715
Description¶
With the continued refactoring of \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
,
the following events have been adapted:
\TYPO3\CMS\Frontend\Event\BeforePageIsResolvedEvent
\TYPO3\CMS\Frontend\Event\AfterPageWithRootLineIsResolvedEvent
\TYPO3\CMS\Frontend\Event\AfterPageAndLanguageIsResolvedEvent
The three events no longer retrieve an instance of TypoScriptFrontendController
, the
getter methods getController()
have been removed: The controller is instantiated
after the events have been dispatched, event listeners can no longer work with this
object.
Instead, the events now contain an instance of the new :abbr:DTO (Data Transfer Object)
:php:
TYPO3CMSFrontendPagePageInformation`, which can be retrieved and
manipulated by event listeners if necessary.
Impact¶
Calling getController()
by consumers of above events will raise a fatal
PHP error.
Also note the events may not be dispatched anymore when the middleware
\TYPO3\CMS\Frontend\Middleware\TypoScriptFrontendInitialization
creates
early responses.
Affected installations¶
Those events are in place for a couple of special cases during early frontend rendering. Most instances will not be affected, but some extensions may register event listeners.
Migration¶
Use method getPageInformation()
instead to retrieve calculated page state at
this point in the frontend rendering chain. Event listeners that manipulate that
object should set it again within the event using setPageInformation()
.
In case middleware TypoScriptFrontendInitialization
no longer dispatches an event
when it created an early response on its own, an own middleware can be added around
that middleware to retrieve and further manipulate a response if needed.