Skip to content

Commit

Permalink
Repair and skip some func tests for TYPO3 11
Browse files Browse the repository at this point in the history
  • Loading branch information
sfroemkenjw authored and hojalatheef committed Sep 22, 2023
1 parent f12c8aa commit 5275e15
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 4 additions & 0 deletions Configuration/Services.yaml
Expand Up @@ -7,6 +7,10 @@ services:
JWeiland\Replacer\:
resource: '../Classes/*'

# Called by makeInstance in tslib/class.tslib_fe.php Hook
JWeiland\Replacer\Hook\TypoScriptFrontendControllerHook:
public: true

# Event Listener Configuration
# This event listener is implemented for replacing the Hook implementation which is removed in TYPO3 12LTS
# the implementation is same as the ReplaceContent Middleware (which only replace for USER_INT Plugins)
Expand Down
15 changes: 6 additions & 9 deletions ext_localconf.php
Expand Up @@ -7,16 +7,13 @@
use TYPO3\CMS\Core\Utility\GeneralUtility;

call_user_func(static function () {
$typo3VersionUtility = GeneralUtility::makeInstance(
Typo3Version::class
);
$typo3VersionUtility = GeneralUtility::makeInstance(Typo3Version::class);

if (version_compare($typo3VersionUtility->getBranch(), '12.4', '>=')) {
// Register hook for cached content
// this has no effect in TYPO3 12 because the hook doesn't exist inside the core and we implemented
// an event listener based on PSR-14 Events 'AfterCacheableContentIsGeneratedEvent'
// For Version above 12.4 instead of Hook implementation PSR 14 Event configured under
// 'Configurations/Services.yaml event we used is AfterCacheableContentIsGeneratedEvent
if (version_compare($typo3VersionUtility->getBranch(), '12.0', '<')) {
// Register hook for cached content.
// This has no effect since TYPO3 12, because the hook doesn't exist inside the core anymore, and we
// implemented an event listener based on PSR-14 Event 'AfterCacheableContentIsGeneratedEvent' which was
// available since TYPO3 12.0.
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all']['z9_replacer'] =
TypoScriptFrontendControllerHook::class . '->contentPostProcAll';
}
Expand Down

0 comments on commit 5275e15

Please sign in to comment.