Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm getting the following error in Sentry:
Comment | File | Size | Author |
---|---|---|---|
#13 | eu_cookie_compliance-function-name-must-be-a-string-2976659-13.patch | 560 bytes | svenryen |
#2 | eu_cookie_compliance-required-settins-2976659-2.patch | 1020 bytes | Berdir |
Comments
Comment #2
BerdirSeeing this too, this is a side effect of how the update process works and the variables are stored.
Workaround: On the settings page, make sure that "Do not store" is selected for the consent storage. For all translations.
The module uses a single huge array for all the variables, which forces it to write update functions to set the new keys (and there are a lot of them).
The problem is that on multilingual sites with variable translation, the whole array is considered a translation and then saved per language. Which means that the update functions only update the default translation and the translations have no key set.
I don't know why the approach with the single array was chosen but it's not going to be possible to change it now. My recommendation would be to put a fallback for required settings in eu_cookie_compliance_get_settings().
I'd say this is at least major.
Comment #3
svenryen CreditAttribution: svenryen at Ramsalt Lab commentedThanks, @berdir. Patch looks okay, but I won't be able to do a full review for the first couple of weeks. I'll try to get this into the branch by end of June.
Comment #4
svenryen CreditAttribution: svenryen at Ramsalt Lab commentedComment #6
svenryen CreditAttribution: svenryen at Ramsalt Lab commentedFixed. Thanks!
Comment #9
fox mulder CreditAttribution: fox mulder commentedI can not find the above changes in the code of the latest stable or in the latest dev
and I experience the error while using the latest stable D7 version ( 7.x-1.32 )
Comment #10
svenryen CreditAttribution: svenryen at Ramsalt Lab commentedLet me double check that. I had some issues while pasting patch files into phpstorm where not all lines got applied, so that could be the case.
Comment #11
svenryen CreditAttribution: svenryen at Ramsalt Lab commented@fox mulder, which version of php and drupal 7 are you using?
There shouldn't be any problem having a function name in a variable.
The code was updated/changed in #3064610: Undefined index notices on cache clear, but should still have the same effect.
Comment #12
svenryen CreditAttribution: svenryen at Ramsalt Lab commentedCan you run `drush vget eu_cookie_compliance` and paste the output here?
Comment #13
svenryen CreditAttribution: svenryen at Ramsalt Lab commented@fox mulder - this is a stab in the dark, I'm guessing that somehow you have an empty value for
consent_storage_method
, not really sure why that's the case. Can you try this patch and let me know how it works? Please respond so that we can either try something else or commit this into the code base.Comment #14
svenryen CreditAttribution: svenryen at Ramsalt Lab commentedComment #15
svenryen CreditAttribution: svenryen at Ramsalt Lab commentedNot sure if there are any test steps for this one, you can probably just do a review by reading the code and then just checking that we don't break any related functionality by applying this patch.
Comment #17
Neslee Canil PintoCommitted to dev branch. Thank you.
Comment #18
Neslee Canil Pinto