From 3b5338a5344a420e98fd1f6282e7bdb5a274187a Mon Sep 17 00:00:00 2001 From: Yorick Reum Date: Tue, 7 Nov 2023 19:43:13 +0100 Subject: [PATCH] Fixed deprecated function call causing fatal error in TYPO3 11.5.32 --- .gitignore | 3 +++ Classes/Hooks/Backend/Toolbar/ClearCacheActionsHook.php | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9f11b75..ea5835d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ .idea/ +.Build +composer.lock +vendor \ No newline at end of file diff --git a/Classes/Hooks/Backend/Toolbar/ClearCacheActionsHook.php b/Classes/Hooks/Backend/Toolbar/ClearCacheActionsHook.php index ec7b5cb..a355de4 100644 --- a/Classes/Hooks/Backend/Toolbar/ClearCacheActionsHook.php +++ b/Classes/Hooks/Backend/Toolbar/ClearCacheActionsHook.php @@ -8,6 +8,7 @@ namespace KayStrobach\Dyncss\Hooks\Backend\Toolbar; use TYPO3\CMS\Backend\Toolbar\ClearCacheActionsHookInterface; +use TYPO3\CMS\Core\Core\Environment; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Backend\Routing\UriBuilder; @@ -26,7 +27,7 @@ class ClearCacheActionsHook implements ClearCacheActionsHookInterface public function manipulateCacheActions(&$cacheActions, &$optionValues) { $clearCacheSystemUser = (bool)($this->getBackendUser()->getTSConfig()['options.']['clearCache.']['system'] ?? false); - $isDevelopment = GeneralUtility::getApplicationContext()->isDevelopment(); + $isDevelopment = Environment::getContext()->isDevelopment(); $clearCacheSystemSys = (bool)$GLOBALS['TYPO3_CONF_VARS']['SYS']['clearCacheSystem'] === true; $isAdmin = $this->getBackendUser()->isAdmin(); if ($clearCacheSystemUser || $isDevelopment || ($clearCacheSystemSys && $isAdmin)) {