After updating the module, a warning message appears about undefined withdraw_message, consent_storage_method and disabled_javascripts indexes in eu_cookie_compliance_page_build() function

Comments

jasa created an issue. See original summary.

jasa’s picture

jasa’s picture

Status: Active » Needs review
StatusFileSize
new1.32 KB

Here's the patch

svenryen’s picture

Thank you for the patch. It addresses the issue, but not in the way I would like it addressed.

The problem was that variables are not set per language. So instead of checking isset(), we should make an update hook and populate the proper default in the database. Also, users of Domain Access will have problems, since defaults are not being set per domain either.

Your patch should be a good remedy meanwhile. You can also fix this problem by saving the settings form for each language.

jyraya’s picture

Hello,

I am meeting the same issue. I worked on the hook_update in order to set parameters of 'eu_cookie_compliance' with default values when they are not defined.
I preferred defining a new hook_update that treats the 'eu_cookie_compliance' variable and its translations because the first update hook that migrated variable values is present since a long time. I nevertheless corrected it to use i18n_variable_set which is more appropriate and to simplify the module enabling control as "i18n_variable" is dependent of "variable_realm".

I kept the content of the jasa's path because it is aligned with what it is implemented elsewhere for mandatory parameters.
For instance, 'popup_agree_button_message' is required but nevertheless there is a isset control on the default value setting.

@svenryen, let me know if that is aligned with what you have in mind.

svenryen’s picture

Hi!

In addition to this, we have problems with defaults for people who use domain access (and possibly combinations of i18n and domain access).
Would you be able to test the code and see that it also sets defaults in those cases?

jyraya’s picture

I will do.

I have some problems to install locally an environment to test domain_access.
I hope to come back with news soon.

osab’s picture

#5 works fine (simple site without domain_access)

norman.lol’s picture

Confirming patch from #5 fixing the issue just fine (on a rather simple site without domain_access).

jasa’s picture

#5 works really fine! thanks for your contribution, should this issue be closed/fixed?

jasa’s picture

Status: Needs review » Fixed
jyraya’s picture

Status: Fixed » Reviewed & tested by the community

The patch still must be pushed. So, the issue cannot be considered as fixed.

@svenryen,

I did not have the opportunity to test the combination of domain_access and i18n butI am still wondering if the problem you are talking about is really linked to the current issue.

Here, we cover 2 cases:

  • A fresh module install where by definition no setting translation has been done yet .
  • A module update where the domain_access settings were no translatable before.

So, could we not achieve this issue and leave the domain access issue fixed via the #2978792: Settings not saved using Domain Access + i18n.

In the meantime, I set the issue in RTBC.

svenryen’s picture

Thanks for reviewing the issue.

  • svenryen committed 3dea59e on 7.x-1.x authored by jyraya
    Issue #2985520 by jasa, jyraya: After updating the module, a warning...
svenryen’s picture

Status: Reviewed & tested by the community » Fixed
navalogan’s picture

Hi,
After update to 7.x-1.x-dev of EU Cookie Compliance module to resolve the consent_storage_method and disabled_javascripts indexes error, i got another error : Fatal error: Using $this when not in object context in /sites/all/modules/eu_cookie_compliance/eu_cookie_compliance.admin.inc on line 136
Have you got any idea ?
Thanks.

navalogan’s picture

Status: Fixed » Active
jyraya’s picture

Status: Active » Fixed

Hello navalogan,

I switch the status back to "fixed" because it is related to another commit and it is treated in #3008905: Error: Using $this when not in object context where I pushed a patch if you want to test it.

Regards.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.