-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Got "Undefined global variable $TSFE" warning in backend:

It look like that $GLOBALS['TSFE'] will be initialized after the "renderPreProcessorProc" hook.
Enviroment:
TYPO3 Version: 11.5.17
Webserver: Apache/2.4.54 (Debian)
PHP Version: 8.1.11
wapplersystems/ws_less: "^11.0"
Following patch will solve the problem:
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/Classes/Hooks/RenderPreProcessorHook.php b/Classes/Hooks/RenderPreProcessorHook.php
--- a/Classes/Hooks/RenderPreProcessorHook.php
+++ b/Classes/Hooks/RenderPreProcessorHook.php (date 1665767227441)
@@ -78,7 +78,9 @@
$sitePath = Environment::getPublicPath() . '/';
- $setup = $GLOBALS['TSFE']->tmpl->setup;
+ $configurationManager = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Configuration\ConfigurationManager::class);
+ $setup = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
+
if (\is_array($setup['plugin.']['tx_wsless.']['variables.'])) {
$variables = $setup['plugin.']['tx_wsless.']['variables.'];
Please update this extension.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels