From faf7c02fd611a25bd9a056af3468c3b14f3b9b64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chris=20M=C3=BCller?= <2566282+brotkrueml@users.noreply.github.com> Date: Wed, 22 Nov 2023 08:07:44 +0100 Subject: [PATCH] [BUGFIX] Use correct object to call pushModuleData() method in AdminModuleController (#225) Resolves: #222 Releases: main, 12.4 --- CHANGELOG.md | 1 + Classes/Controller/AdminModuleController.php | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c898921..10bdc15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Fixed - Dynamic properties in ModuleController (#221) +- Use correct object to call pushModuleData() method in AdminModuleController (#222) ## 12.0.1 - 2023-09-16 diff --git a/Classes/Controller/AdminModuleController.php b/Classes/Controller/AdminModuleController.php index 929c808..d6d7947 100644 --- a/Classes/Controller/AdminModuleController.php +++ b/Classes/Controller/AdminModuleController.php @@ -21,6 +21,7 @@ use TYPO3\CMS\Backend\Template\Components\ButtonBar; use TYPO3\CMS\Backend\Template\ModuleTemplate; use TYPO3\CMS\Backend\Template\ModuleTemplateFactory; +use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Localization\LanguageService; @@ -54,7 +55,7 @@ public function handleRequest(ServerRequestInterface $request): ResponseInterfac $moduleData = $request->getAttribute('moduleData'); if ($moduleData->cleanUp($allowedOptions)) { - $languageService->pushModuleData($moduleData->getModuleIdentifier(), $moduleData->toArray()); + $this->getBackendUser()->pushModuleData($moduleData->getModuleIdentifier(), $moduleData->toArray()); } $moduleTemplate = $this->moduleTemplateFactory->create($request); @@ -143,4 +144,9 @@ private function getLanguageService(): LanguageService { return $GLOBALS['LANG']; } + + private function getBackendUser(): BackendUserAuthentication + { + return $GLOBALS['BE_USER']; + } }