direct_mail icon indicating copy to clipboard operation
direct_mail copied to clipboard

Do not rely to $GLOBALS['LANG']

Open froemken opened this issue 11 months ago • 0 comments

Hello,

following line breaks as $GLOBALS['LANG'] is not defined: https://github.com/kartolo/direct_mail/blob/944392cb644a7e44111aa20a5cc33c75d50985b9/Classes/SelectCategories.php#L85

I have searched for a while to find out where and when $GLOBALS['LANG'] will be defined. It is only available in backend context and in some CLI commands, but for frontend usage I found following line in TYPO3 core:

https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Localization/LanguageService.php#L29-L30

So, please check if $GLOBALS['LANG'] is available first and/or initialize it on your own.

Thank you for your work

Stefan

froemken avatar Mar 07 '24 10:03 froemken