KaufmannDigital.GDPR.CookieConsent
KaufmannDigital.GDPR.CookieConsent copied to clipboard
Fix type error when no consents have been set yet
Make sure $consents
is an array instead of null
when not set in $cookie
at all.
Fixes #47
Thanks for your PR @kdambekalns!
Unfortunately, I could not reproduce the problem. The code is located in a try-catch block. This should actually ensure that these exceptions get catched and an empty JavaScript is generated, as long as not all necessary parameters are set via the cookie.
In my tests, the whole thing worked, so that it never came to the error (PHP 8.1). Only if I remove the try-catch block, I get an error.
The fix does not lead to any other error, but I still get other exceptions with the fix, which lead to the same result with try-catch.
Maybe I'm missing something and you can help me out.... You can also reach my via Slack, if thats easier :)
Hi @kdambekalns, I wasn't able again to reproduce your described problem. But since this should not break something and it worked for me in my tests, I'll get this into v5 now.
Sorry for not getting back to this, I had hoped to find time to verify it again. But the issue was real… 🤷♂️
Thanks for merging! ❤️🔥