CodersCare / gridelements

Be part of the future of TYPO3! Support Gridelements now and unlock exclusive early access to v13! The well-established Gridelements V12 elevates TYPO3 by bringing grid-based layouts to content elements, with powerful features like advanced drag & drop and real references. Supercharge your workflow and make daily tasks easier. Sponsor us here:
https://coders.care/for/crowdfunding/gridelements
GNU General Public License v3.0
5 stars 25 forks source link

Trying to access $GLOBALS['BE_USER'] in FE results in logs being flooded with warnings #59

Open sypets opened 1 year ago

sypets commented 1 year ago

Core: Error handler (FE): PHP Warning: Undefined global variable $BE_USER in /var/www/mysite/public/typo3conf/ext/gridelements/Classes/Backend/LayoutSetup.php line 749 I have lots of warnings like these in the "Log" (sys_log).

Unfortunately, I don't have a stack trace for this. It is strange that this is accessed in the FE, shouldn't be or there should be a check there.

code:

   747      public function getBackendUser(): ?BackendUserAuthentication
   748      {
   749          return $GLOBALS['BE_USER'];
   750      }

Versions

Cybercraft-GmbH commented 1 year ago

This seems to be used by "setLanguageService" only, which again is used in BE context only, so it should be enough to add ?? null in line 749