Hi!
After updating to the 7.x-1.35 version I get the following errors at /admin/config/system/eu-cookie-compliance
Notice: Undefined index: popup_position in eu_cookie_compliance_admin_form() (regel 642 van /var/www/customprojects/teakpoint/dev/docroot/sites/all/modules/contrib/eu_cookie_compliance/eu_cookie_compliance.admin.inc).
Notice: Undefined index: popup_position in eu_cookie_compliance_admin_form() (regel 642 van /var/www/customprojects/teakpoint/dev/docroot/sites/all/modules/contrib/eu_cookie_compliance/eu_cookie_compliance.admin.inc).
Notice: Undefined index: popup_position in eu_cookie_compliance_admin_form() (regel 642 van /var/www/customprojects/teakpoint/dev/docroot/sites/all/modules/contrib/eu_cookie_compliance/eu_cookie_compliance.admin.inc).
After filling in all the fields and clicking save I return to the same page but the fields I filled in are fully blank again.
Any help would be appreciated.
-
I upgraded from version 7.x-1.34, the problem already occured in 1.33. Everything went good in version 1.32.
Output from drush vget eu_cookie_compliance:
eu_cookie_compliance: { }
eu_cookie_compliance_categories: { }
eu_cookie_compliance_cookie_lifetime: '100'
eu_cookie_compliance_domain: ''
Comments
Comment #2
svenryen commentedHi!
Which version did you upgrade from?
Can you run
drush vget eu_cookie_complianceand share the output here?Comment #3
Samle commentedHello Sven
I did upgrade from 7.x-1.34 but there also my GDPR banner wasn't showing up, I had no problems with version 7.x-1.32.
The output of drush vget eu_cookie_compliance:
eu_cookie_compliance: { }
eu_cookie_compliance_categories: { }
eu_cookie_compliance_cookie_lifetime: '100'
eu_cookie_compliance_domain: ''
Comment #4
svenryen commentedThanks. Which version of Drush are you using? Is it possible for you to expand the eu_cookie_compliance variable?
I get a full output from Drush 8.
Comment #5
Samle commentedI checked my Drush version and right now it's 7.4.0.
How can I expand the eu_cookie_compliance variable?
Comment #6
svenryen commentedAre you saying that the banner doesn't show up at all, even in an Incognito window?
Any chance you can dig into your database and run this instead:
select value from variable where name = 'eu_cookie_compliance';Have you tried saving the configuration?
Do you use multiple languages or the domain module?
Comment #7
neslee canil pinto@Samle I did a test on my local machine with the instructions specified above and I am not able to reproduce your error.
Comment #8
svenryen commentedIs the site live somewhere? Can you set up a staging site for us to test?
Comment #9
svenryen commentedJust checking, you did run
drush updb?Comment #10
anybodyComment #11
svenryen commentedThanks for changing the state, @Anybody.
@Samle, if you provide additional details, we can reopen the issue. I have seen the same situation myself and resolved it by reinstalling the module, so there definitely can be an issue there under some cases. So please provide any information you think is useful for us.
Comment #12
cbeier commentedI have the same problem (or the same error message) with a page after the update. After some tests I could observe the following:
Initial situation:
Update eu_cookie_compliance from 1.32 to 1.35.
The site is a multisite installation (different databases) and one site is multilingual (i18n_variable).
After updating the module and run the updates (drush updb or update.php) the settings array is empty (
variable_get('eu_cookie_compliance')is empty).Also, the revert of the Feature (with the exported settings from eu_cookie_compliance module -> Strongarm) has no effect. The module settings of the EU Cookie Compliance Module remain empty.
After resetting the DB (to the state before the update) I executed the update functions one by one:
I think the problem occurs only in connection with multilingual websites (i18n_variable module enabled).
I compared the past update functions with the eu_cookie_compliance_update_7017 function:
variable_realm_set('language', $langcode, 'eu_cookie_compliance', $updated_setting, FALSE)i18n_variable_set('eu_cookie_compliance_categories', $categories, $langcode)After I changed the save function in function
eu_cookie_compliance_update_7017()fromi18n_variable_set()tovariable_realm_set(), there was no problem after executing all update functions.I hope the information will be helpful.
Comment #13
svenryen commentedThanks @cbeier, for debugging this issue. That was really helpful. I've been able to come up with a patch.
Can any of you take this patch for a spin and see if it resolves your issue? You'd have to roll back to 1.32 (or set up a test site) and run
drush updbagain.Test steps:
1. Set up a site with 2 or more languages
2. Install version 1.32 of EU Cookie Compliance
3. Save configuration for each language
4. Update to 1.35 and apply this patch
You should now see your stored config when you visit the setting page for this module, rather than the default config and the error message.
Comment #14
Samle commentedHello Sven,
I just updated to the 7.x-1.36 version. I still get the following error on my website and it's still not working.
I can't save any data nor enable the banner while in the admin page.
See the attachment for more info.
Comment #15
cbeier commentedUnfortunately the patch does not work. The described behaviour still occurs, that the module settings are empty after running the updates.
I will try to analyze this more in detail.
Comment #16
cbeier commentedI have changed the patch from #13.
The problem was that i18n_variable_get loaded the settings for all languages and saved them later. Even if the result for one language was empty.
In my installation the module settings for the default language (of the drupal installation) is saved via variable_set(). For this (default) language, the result of i18n_variable_get() is empty. If this empty result is now saved as a realm variable, the module settings (for the default language) then always come from i18n_variable_get() and no longer from variable_get().
Comment #17
francoud commentedI noticed the same problem in one multilingual website, but was too late to restore a previous database. Anyway, I am now able to run version 1.36 without a patch. What I did:
- disable and uninstall the module (note that simply reinstalling again didn't solve the problem)
- in the database, using phpmyadmin, I manually deleted every occurrence of "eu_cookie" in every table. This included >200 entries in the "Locale" table, and an entry in the "system" table, where the eu_cookie module was still listed
- upgraded the module (was: 1.33, updated to: 1.36) on the filesystem
- install the module from zero in the website.
And of course I had to create again all the configuration (banner content, etc.).
Well, empirical but it solved my problem without patching the module.
Note that in a multilingual enviroment, you should also configure the "eu cookie compliance" variable to have different cookie profiles for different languages. http://your.website/admin/config/regional/i18n/variable (other).
In that website, I didn't selected that variable, and I had the problem. In another multilingual website, where the variable was selected in that configuration, the module, 1.36, worked without any problem.
Hope this will help...?
Comment #18
alesbencina commentedLike francout mentioned
you have to go to the /nl/admin/config/regional/i18n/variable and check EU Cookie Compliance so the settings are set for every language.
Comment #19
quotientix commentedThanks alesbencina, #18 helped!
Comment #20
mile23Interdiff from #13 to #16.
This issue looks to be similar to #3189115: Updating from 7.x-1.32 to 1.35 destroyed my config, because that issue only applies to multilingual sites as well. Other sites work fine.
Comment #22
svenryen commentedComment #25
arx-e commentedI had 7.x-1.36 installed and now the latest dev (7.x-1.36+21-dev (2021-May-25)) but as soon as I visit the config page (admin/config/system/eu-cookie-compliance) I get the triplet of notices and the page isn't saving settings. I tried uninstalling, cleanup and reinstallation as described in #17 but that didn't have any effect.
I think I had set up the module long time ago with some previous version and it used to work fine.
Comment #26
arx-e commentedI don't know whether it is correct but my solution was to catch that undefined setting in an if statement. So now I can save the settings and I haven't done extensive testing but it seems to work.
This is what I replaced line 642 with:
Comment #27
svenryen commentedThanks for the report, @arx-e , I'll take a look.
Does your site have multiple languages, or do you use the Domain module?
Comment #28
arx-e commentedYes, the site where I saw this problem has English and Greek activated and Greek as the default language. I tried setting English as the default but it didn't solve the issue,
Basically when visiting the admin page there was nothing selected on the Position section (neither Top nor Bottom),
Still I have at least a couple other Drupal 7 sites with the same language setup where this error is not occurring.
And I am not using the Domain module anywhere.
Comment #29
svenryen commentedarx-e, would you mind doing a
drush vget eu_cookie_complianceand either paste the result here or send it to me through the contact form (click my user name to find my contact form on drupal.org)? I'd like to see what's the actual value for$popup_settings['popup_position']Comment #30
arx-e commentedOf course! Here is what I just got:
Comment #31
arx-e commentedBut I am not sure this is useful because right after outputing the variables I went back and reverted the eu_cookie_compliance.admin.inc file line 642 to its original form and I can't see the error. The "Bottom" option is now selected and I can save the settings page.
I will try to find the previous state of the site to see if I can get the variables as they were when the error occurred.
Comment #32
arx-e commentedOk I got access to the site as it was before 15 July. The module had been installed some time more than a year ago (I can not remember when) but at some point had stopped working (hadn't noticed -_-).
So with 7.x-1.36 installed I got the following from
drush vget eu_cookie_compliance:After deactivating, uninstalling and reinstalling the module I got
And in both cases I get the error on line 642 and I am unable to save the settings page.
Comment #33
youlikeit commentedI have the same error message although after applying patches, deinstall the module and installing the dev version.
Comment #34
svenryen commented@youlikeit and @arx-e, have you installed the dev-version or 1.36?
Comment #35
arx-e commented@svenryen I just tested updating 7.x-1.36 to 7.x-1.36+22-dev (2021-July-30) (also run the update 7019) and the problem continues the same.
I repeated the above test on a local copy of the site I have kept from 14 July.
On the live site I have solved the issue by applying the solution I described in #26. After visiting the page once with that code the value for top/bottom gets saved and I don;t see any other problem.
Comment #36
svenryen commentedI went ahead and committed the suggested change from #26. For the record, here's the code as a patch.
Comment #38
svenryen commentedComment #39
neslee canil pinto