Closed (fixed)
Project:
EU Cookie Compliance (GDPR Compliance)
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
25 Dec 2020 at 06:52 UTC
Updated:
17 Sep 2021 at 13:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
Alexander Kalashnik commentedComment #3
Alexander Kalashnik commentedComment #4
Alexander Kalashnik commentedComment #6
Alexander Kalashnik commentedComment #7
Phil Wolstenholme commentedI had this issue too, I've updated the title to be a bit more specific.
The issue is caused by these lines: https://git.drupalcode.org/project/eu-cookie-compliance/-/blob/8.x-1.x/e...
They reset the values of thee
popup_agreed,popup_info,mobile_popup_info,withdraw_messagemessages and text format. This would be fine for a fresh installation of the module on a site that has not used it before, but it causes issues when the site is being reinstalled using a profile that already contains customised message/format settings in aeu_cookie_compliance.settings.ymlfile within the profile.Alexander's patch works for me, now when I reinstall my sites using a profile the text format and message settings are no longer wiped by the install hook.
A next step is to check that the patch from this issue still fixes the original issue described at https://www.drupal.org/project/eu_cookie_compliance/issues/2979440.
Comment #8
bwaindwain commentedPatch #4 works for our distro. Thanks @alexander-kalashnik!
Comment #9
codebymikey commentedI believe the original #2979440: EU Cookie Compliance expects specific text formats to exist issue has a point, and the module should validate whether the format exists.
However the current #2979440 code is still fundamentally broken, as it doesn't work on "standard" profiles either because at the point where eu_cookie_compliance is being installed, there's no reference to the
restricted_htmlformat, so it always defaults toplain_text.With the current patch, the config will always exist, so the ternaries in the current patch might be unneeded - the #2979440 code can be simply removed in order to achieve the original behaviour.
I've added a patch which allows individual sites to opt out of the behaviour using a
settings.phpoverride:It can be argued that the default setting value should be switched around, as minimal profiles are probably in the minority, and should be the ones to opt in to the new behaviour instead, but as the code is already committed and released, it's currently an opt-out to avoid introducing yet another breaking change.
Alternative solutions are to:
eu_cookie_compliance.settingsprofile configuration post install (slightly better).Comment #11
svenryen commentedComment #12
svenryen commentedRe-rolled patch.
Comment #14
svenryen commentedI changed the cookie banner message, exported config, then installed using existing config and the changes were preserved.
Thanks for the patch!
Comment #16
zacharie.montreuil commentedI've noticed that the patch no longer works in 9.2.x -- a straightforward reroll will use the proper message settings, but not the text format.