From 5a68261482cee9e53dc317e6908f7fb5d6dd511a Mon Sep 17 00:00:00 2001 From: Torben Hansen Date: Thu, 17 Oct 2024 16:33:09 +0200 Subject: [PATCH] [TASK] Remove isFrontendEditingActive check This change removed the `isFrontendEditingActive` check, because it uses TSFE properties, which have been removed in TYPO3 v12.0 --- Classes/Hooks/PageLoadedFromCacheHook.php | 2 -- Classes/Hooks/RequestAwareTrait.php | 11 ----------- Classes/Hooks/SetPageCacheHook.php | 1 - 3 files changed, 14 deletions(-) diff --git a/Classes/Hooks/PageLoadedFromCacheHook.php b/Classes/Hooks/PageLoadedFromCacheHook.php index 5b7c16b..585c4e7 100644 --- a/Classes/Hooks/PageLoadedFromCacheHook.php +++ b/Classes/Hooks/PageLoadedFromCacheHook.php @@ -64,7 +64,6 @@ public function handleEvent(AfterTypoScriptDeterminedEvent $event): void $context->getPropertyFromAspect('workspace', 'isOffline', false) === false && strpos($uri, '?') === false && $this->isAdminPanelVisible($frontendTypoScript) === false && - $this->isFrontendEditingActive($tsfe) === false && $request->getMethod() === 'GET' ); @@ -110,7 +109,6 @@ public function loadedFromCache(array &$params, TypoScriptFrontendController $ts $context->getPropertyFromAspect('workspace', 'isOffline', false) === false && strpos($uri, '?') === false && $this->isAdminPanelVisible() === false && - $this->isFrontendEditingActive($tsfe) === false && $request->getMethod() === 'GET' ); diff --git a/Classes/Hooks/RequestAwareTrait.php b/Classes/Hooks/RequestAwareTrait.php index 7cda1e4..2833b3d 100644 --- a/Classes/Hooks/RequestAwareTrait.php +++ b/Classes/Hooks/RequestAwareTrait.php @@ -53,17 +53,6 @@ protected function isAdminPanelVisible(?FrontendTypoScript $frontendTypoScript = ); } - protected function isFrontendEditingActive(TypoScriptFrontendController $frontendController): bool - { - return ( - /* Note: we do not use $GLOBALS['BE_USER']->isFrontendEditingActive() as that checks - * additional for adminPanel->isAdminModuleEnabled('edit'), but that has no influence - * on cache clearing. */ - $frontendController->displayEditIcons == 1 || - $frontendController->displayFieldEditIcons == 1 - ); - } - protected function getUri(ServerRequestInterface $request): string { $normalizedParams = $this->getNormalizedParams($request); diff --git a/Classes/Hooks/SetPageCacheHook.php b/Classes/Hooks/SetPageCacheHook.php index 74c70e8..5cca0e8 100644 --- a/Classes/Hooks/SetPageCacheHook.php +++ b/Classes/Hooks/SetPageCacheHook.php @@ -72,7 +72,6 @@ public function set(array $params, FrontendInterface $frontend): void $tsfe !== null && $tsfe->isStaticCacheble($request) && $context->getPropertyFromAspect('workspace', 'isOffline', false) === false && - $this->isFrontendEditingActive($tsfe) === false && in_array('nginx_cache_ignore', $tags, true) === false );