t3solution / t3sbootstrap

Startup extension to use bootstrap 5 classes, components and more out of the box.
GNU General Public License v2.0
25 stars 20 forks source link

Undefined array key "cookieconsent_status" #367

Open Hobokens opened 8 months ago

Hobokens commented 8 months ago

PHP Version 8.1.22 TYPO3 11.5.31 t3sbootstrap 5.2.7

My log file is flooded with the following error message:

Core: Error handler (BE): PHP Warning: Undefined array key "cookieconsent_status" in /www/htdocs/xxxx/my-domain,de/typo3_src-11.5.31/vendor/symfony/expression-language/Node/GetAttrNode.php line 97

t3solution commented 8 months ago

... as a workaround you can remove the following lines from the file /typo3conf/ext/t3sbootstrap/Configuration/TypoScript/setup.typoscript :

[{$bootstrap.gtm} && {$bootstrap.extconf.cookieconsent} == 1 && request.getCookieParams()['cookieconsent_status'] == 'allow']
page.includeJS.gtm = https://www.googletagmanager.com/gtag/js?id={$bootstrap.gtm}
page.includeJS.gtm.external = 1
page.includeJS.gtm.async = 1
page.jsInline.1 = TEXT
page.jsInline.1.value (
        // Google Tag Manager
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
        gtag('config', '{$bootstrap.gtm}');

)
[global]
Hobokens commented 7 months ago

Thanks for your helpful advice.