Closed hphoeksma closed 1 year ago
Hi @hphoeksma!
First of all sorry for my late response and thanks for your contribution! There was a bit more to do on this package and we wasn't able to do it until now.
When/How did you get the error, you described and made you do this fix? I just tried it on our projects, and everything worked fine, even if the user did not select something and the Cookie wasn't set.
There is a try-catch block around all the logic, which prevents Neos from throwing errors on such a case. Instead just an empty response is returned. (See https://github.com/KaufmannDigital/KaufmannDigital.GDPR.CookieConsent/blob/master/Classes/Controller/JavaScriptController.php#L141)
Could you come up with an example, how to reproduce your problem? I would really like to find the problem here :) Thank you very much!
Niklas
@Nikdro I need to dive into when I ran into this... At the moment I am running low on time to do so. I will make a remark on my todo list to get to this asap!
Thanks! Looking forward to hear from you!
Isn't that the same issue as solved with https://github.com/KaufmannDigital/KaufmannDigital.GDPR.CookieConsent/pull/48?
@Nikdro I just updated the Neos distribution I am using this in with the latest version, and the error returns again: Warning: Undefined array key "KD_GDPR_CC"
It kinda makes sense since on line 86 you call an array with the cookie name index without checking if the index is set:
$cookie = json_decode($this->request->getHttpRequest()->getCookieParams()[$this->cookieName], true);
I updated the code to match the current master state.
@franzkugelmann
Isn't that the same issue as solved with #48?
No, as the error is triggered in the line above that one.
Thank you very much @hphoeksma! Just published new Versions with your fix!
Fixes a
Notice: Undefined index: KD_GDPR_CC
warning when the cookie is not yet set by the user.