lochmueller/staticfilecache

Exception with PHP 8.0

topfender opened this issue · 4 comments

Hey

I get the following exception in fe:
PHP Warning: Undefined array key "TSFE" in /var/www/html/htdocs/typo3conf/ext/staticfilecache/Classes/Cache/Listener/StaticCacheableListener.php line 23

Environment

  • TYPO3: 11.5.4
  • staticfilecache version: 12.4.0
  • Composer Mode
  • PHP 8.0

Thanks @topfender for reporting. Please check current master. If the problem is fixed completely I will release a new version...

Could you add the ($GLOBALS['TSFE'] ?? null) to all conditions where $GLOBALS['TSFE'] is checked. I get similar errors for example in the Rule/NoNoCache.php or Rule/NoWorkspacePreview.php.
grafik

I really don't get why the TSFE key is sometimes not present. I think those PHP 8 warning are really annoying :D

Hey @topfender
Thanks... I fixed this in current master.
In the future TSFE part should be dropped, because the TSFE is also part of the request object.
Regards,
Tim

The same warning also appears in:

  • staticfilecache/Classes/Cache/Rule/ValidPageInformation.php line 26
  • staticfilecache/Classes/Cache/Rule/NoNoCache.php line 24
  • staticfilecache/Classes/Cache/Rule/LoginDeniedConfiguration.php line 24
  • staticfilecache/Classes/Cache/Rule/NoIntScripts.php line 24