Breaking: #97862 - Hooks related to generating page content removed
See forge#97862
Description
The existing TYPO3 hooks in the process of generating a TYPO3 Frontend page
$GLOBALS
['TYPO3_ CONF_ VARS'] ['SC_ OPTIONS'] ['tslib/ class. tslib_ fe. php'] ['content Post Proc- cached'] $GLOBALS
['TYPO3_ CONF_ VARS'] ['SC_ OPTIONS'] ['tslib/ class. tslib_ fe. php'] ['content Post Proc- all'] $GLOBALS
['TYPO3_ CONF_ VARS'] ['SC_ OPTIONS'] ['tslib/ class. tslib_ fe. php'] ['use Page Cache'] $GLOBALS
['TYPO3_ CONF_ VARS'] ['SC_ OPTIONS'] ['tslib/ class. tslib_ fe. php'] ['insert Page Incache']
have been removed. These hooks have been used to execute custom PHP code after a page is generated in the TYPO3 frontend and ready to be stored in cache.
Due to the removal of the hooks and the introduction of the new PSR-14 events
the method signature of Typo
has been changed. The method now requires a Server
as first
argument.
Impact
Extension code that hooks into these places will not be executed anymore in TYPO3 v12+.
Extension code calling Typo
without providing a Server
as first argument
will trigger a PHP Argument
.
Affected installations
TYPO3 installations with custom extensions using these hooks such as static file generation or modifying the page content cache, which is highly likely in third-party extensions. The extension scanner will detect usages as strong match.
Extensions, manually calling Typo
without providing a Server
as first argument. The
extension scanner will detect usages as weak match.
Migration
Use one of the two newly introduced PSR-14 events:
\TYPO3\
CMS\ Frontend\ Event\ After Cacheable Content Is Generated Event \TYPO3\
CMS\ Frontend\ Event\ After Cached Page Is Persisted Event
Extensions using the hooks can be made compatible with TYPO3 v11 and TYPO3 v12 by registering a PSR-14-based event listener while keeping the legacy hook in place.
The After
acts as a replacement for
$GLOBALS
['TYPO3_ CONF_ VARS'] ['SC_ OPTIONS'] ['tslib/ class. tslib_ fe. php'] ['content Post Proc- cached'] $GLOBALS
['TYPO3_ CONF_ VARS'] ['SC_ OPTIONS'] ['tslib/ class. tslib_ fe. php'] ['content Post Proc- all'] $GLOBALS
['TYPO3_ CONF_ VARS'] ['SC_ OPTIONS'] ['tslib/ class. tslib_ fe. php'] ['use Page Cache']
whereas the After
is the replacement for
$GLOBALS
.
Provide a Server
as first argument when calling
Typo
in custom
extension code.