From cc9ea4285339abd5b5912777f4995200344d0105 Mon Sep 17 00:00:00 2001 From: Christian Sonntag Date: Wed, 26 Feb 2020 16:15:36 +0100 Subject: [PATCH] [FIX] fix Security Viewhelper for TYPO3 v10 --- .../ViewHelpers/Security/AbstractSecurityViewHelper.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Classes/ViewHelpers/Security/AbstractSecurityViewHelper.php b/Classes/ViewHelpers/Security/AbstractSecurityViewHelper.php index 83889ed05..8b07a36e7 100644 --- a/Classes/ViewHelpers/Security/AbstractSecurityViewHelper.php +++ b/Classes/ViewHelpers/Security/AbstractSecurityViewHelper.php @@ -338,10 +338,11 @@ public function assertAdminLoggedIn() */ public function getCurrentFrontendUser() { - if (true === empty($GLOBALS['TSFE']->loginUser)) { - return null; + if ($GLOBALS['TSFE']->isUserOrGroupSet()) { + return $this->frontendUserRepository->findByUid($GLOBALS['TSFE']->fe_user->user['uid']); } - return $this->frontendUserRepository->findByUid($GLOBALS['TSFE']->fe_user->user['uid']); + + return null; } /**