Closed (fixed)
Project:
EU Cookie Compliance (GDPR Compliance)
Version:
8.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Mar 2019 at 20:56 UTC
Updated:
5 Apr 2019 at 16:54 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
kruser commentedSame:
Comment #3
kruser commentedComment #4
hilatti commentedI am getting the same error.
Comment #5
FanisTsiros commentedSame here. Update to 8.x-1.3 form 8.x-1.2 crashed all site.
Admin pages are accessible so i was able to unistall the module.
Error: Call to a member function __toString() on string in eu_cookie_compliance_page_attachments() (line 231 of /var/www/vhosts/xxxxxxxxx.com/httpdocs/modules/eu_cookie_compliance/eu_cookie_compliance.module) #0Comment #6
yazzbe commentedGot the same error, but managed to work around.
Luckily I was logged in, so I managed to update the module settings;
- consent method selected (radio button)
- but NO default option is selected for "info banner template"
- selected the first option
Error was gone and site is back up now.
Comment #7
Andy_D commentedThis is probably made worse by the security update last night.
yoursite
/admin/config/system/eu-cookie-complianceis the path to configI'll add an image in a bit.
You could try
drush config:edit eu_cookie_compliance.settingsand the setting you need to add ispopup_info_template: legacy(credit to @yazzybe for the fix!)
Comment #8
Andy_D commentedView of setting in system:

Note that both of these are empty when first seen.
Comment #9
jankap commented@yazzybe
Thank you, same solved it here.
But I guess I will wait for a next version to update all my live sites ;-)
Comment #10
spokjeNice catch @yazzbe!
Seems like this is introduced by https://www.drupal.org/node/2985662 which introduces a new setting 'popup_info_template', but doesn't seem to add in a
hook_update.Will work on a patch next.
EDIT: @Andy_D beat me to it :)
Comment #11
Andy_D commentedUpdating the title to reflect the seriousness of this issue.
Comment #12
spokjeAttached patch should add the missing
popup_info_template: legacywhen it's not there.Thanks to @Andy_D and @yazzbe for the solid investigation.
Note to maintainer: Retro-updating
hook_update_nis never a good idea, and is what caused this issue.Thanks for the hard work on this module! :)
Comment #13
spokjeComment #15
spokjeIt seems that testbot marks modules with no tests as
Build Successfulwhich turns intoNeeds Work (failed testing)I like that idea, but it doesn't mean this patch is breaking stuff (
Build Successfulindicates at the very least the patch applied cleanly).Putting this back to
Needs Review.Comment #16
idebr commented#15 This issue is under investigation, see DrupalCI: Test Runner issue queue at #2990645: "Build Successful" is treated as a test failure
The patch in #12 applies correctly to 8.x-1.x and fixes the configuration for existing installations updating from 8.x-1.2 to 8.x-1.3
Comment #17
spokjeThanks @idebr was looking for that issue to confirm my ramblings in #15
Comment #18
spokjeArgh, reverted back to RTBC
Comment #19
spokjeTitle update to make clear we're talking about the D8 version.
Comment #20
gngn commentedQuick fix: goto the settings page (admin/config/system/eu-cookie-compliance) and save (worked for me).
---
Long version: Updating 8.x-1.2 -> 8.x-1.3 I got changes in eu_cookie_compliance.install
So the new config popup_info_template is set to legacy - but in an old (and already executed) update!
*Update*: like noted in #12 by Spokje:
For me it was enough to go to the settings page (admin/config/system/eu-cookie-compliance) and save.
But then I got the changed config
popup_info_template: new- notlegacy!Looking at the code I found in EuCookieComplianceConfigForm::validateForm():
and yeah - I do not have method 'consent by default'.
I do not know about the consequences, but I think the new update-function eu_cookie_compliance_update_8111() should consider this.
Something like this:
Setting back to needs review.
Comment #21
gngn commentedPatch following the thoughts in #20 attached.
Comment #22
gngn commentedBtw: #21 (as well as #12) requires database update - e.g.
drush updatedb.Comment #24
gngn commentedSetting to needs-review (see #15)
Comment #25
svenryen commentedReviewing it now.
Comment #26
svenryen commentedComment #28
svenryen commentedThis has been committed to -dev. We're waiting for feedback on this other issue before we can tag a new release.
#3038214: [D8] \Drupal\Component\Utility\Xss::filter introduced in 8.x-1.3 filters valid html from existing configuration
Comment #29
spokjeChanging this to Fixed since it has been committed to the Dev-branch
Comment #30
svenryen commentedIt was actually tagged in 1.4 right now :)
Comment #31
luke adams commentedAn additional note here, for anyone still using features to manage these sorts of configs (I know, not advisable), you'll want to update your eu_cookie_compliance.settings.yml file with this new config key/value. I had updated to 1.4, rebuilt the site but was still getting the same error. Validated that the update hook had actually run by checking the schema value in the db and figured features had to have something to do with reverting/unsetting the updated value...
Simply add the following new line after the popup_info definition (first I used 'legacy' and it broke our custom styling for the banner, 'new' worked and maintained the custom styles):
popup_info_template: newRevert features and you should be good to go.
Comment #32
aleksi_anisimov commentedI am just wondering, how it comes that security update which is supposed to solve some issues causes new issues that cannot be solved without applying new patches?
Are those security update even tested, or what?
Why is is such a pain all the time to roll out update (which are even minor updates, by the way)?
Comment #33
svenryen commentedaleksi_anisimov. You hit it spot on, the added features were not tested well enough for all configurations. We regret the inconvenience, and you're more than welcome to help maintain or test the module.