Closed (fixed)
Project:
EU Cookie Compliance (GDPR Compliance)
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Feb 2020 at 23:04 UTC
Updated:
23 Oct 2020 at 18:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
svenryen commentedHi!
Thanks for the report. I'll take a look.
It would help speed up the debugging if you could run
drush vget eu_cookie_complianceand paste the result here.Comment #3
mxtComment #4
svenryen commentedThanks. I'll take a look.
Comment #5
svenryen commentedDo you by any chance have a multilingual web site? I can't reproduce directly.
Comment #6
svenryen commentedComment #7
goekmen commentedI also have this problem
Notice: Undefined index: consent_storage_callback in eu_cookie_compliance_store_consent() (Zeile 858 von /****/modules/eu_cookie_compliance/eu_cookie_compliance.module).I am runnig a multilingual website.
Comment #8
mxtYes I have a multilingual website.
Comment #9
danjuls commentedSame here, multilingual site and the same notice.
Comment #10
anybodyOk let's have a look...
ctools_get_plugins('eu_cookie_compliance', 'consent_storage', $consent_storage_method);
doesn't return a proper value (method name). The reason might be outside, for example it would be interesting to hear which ctools versions the users are using here and what's returned instead.
Anyway I'd suggest to check by function_exists($consent_storage_function) that the given function exists and log error details if not. Furthermore I'm a bit afraid if it's secure to call a function returned by variable without limitations and prior checks?
Comment #11
fgiacanelli commentedHello,
just a quick note:
it happened to one of our sites when upgrading from the version 7.x-1.31 of the module to the 1.32.
The prior istallation didn't have the consent_storage_method variable thus it was set to null.
The 1.32 configuration screen offers the choice with a radio button:
- Do not store (selected by default)
- basic storage
It appears that if the user doesn't intentionally save the configuration for *every* language of a multi language site, the variable is null so throwing the error when a user clicks on accept on the banner.
Note: I didn't inspect the code, I just reproduced the error. I set the variable first on a single language: no more errors in the log for users landing on that language, more errors for users landing on the other language (you can check this by manually going on the home page of a language on a new incognito/anonyous browser window). When I saved the the configuration on the second language, all errors disappeared.
Workaround: re-save the configuration after every upgrade for every language installed.
Comment #12
svenryen commentedComment #13
svenryen commentedHere's a patch that should resolve the issue.
Test notes:
- Install the module first and then set up a Drupal 7 site with several languages.
- Do *not* save the configuration for the other language, leaving the variable for Consent Storage Method unconfigured.
- Visit the site on the other language and verify that the error doesn't happen.
Comment #14
svenryen commentedComment #16
neslee canil pintoCommitted to 7.x dev branch. Thank you.
Comment #17
neslee canil pinto