In version 8.x-1.20-rc1:

  • if the user accepts cookies and then later withdraws consent, the privacy button remains present allowing the user to change their mind and accept cookies again - ** this is good **
  • if the user rejects cookies, the privacy settings button disappears after the page is reloaded (or they browse to another page) and so the user cannot change their mind and accept cookies again - **this not good**

In the previous version 8.x-1.19, if the "Enable floating privacy settings tab and withdraw consent banner" and "Enable floating privacy settings tab after withdrawing consent" options are enabled, the privacy settings button is always available even after the user rejects cookies or withdraws consent.

Steps to reproduce

  1. Enable the Opt-in option "Don't track visitors unless they specifically give consent"
  2. Enable the options "Enable floating privacy settings tab and withdraw consent banner" and "Enable floating privacy settings tab after withdrawing consent"
  3. When the cookie consent banner pops-up, reject cookies
  4. Refresh the page
  5. The privacy setting button is no longer present
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Glugmeister created an issue. See original summary.

glugmeister’s picture

I think the issue might be caused by this condition not being fired at line 174 of eu_cookie_compliance.js:

if (_euccCurrentStatus === cookieValueDisagreed && drupalSettings.eu_cookie_compliance.settings_tab_enabled && (drupalSettings.eu_cookie_compliance.method === 'opt_in' || drupalSettings.eu_cookie_compliance.method === 'categories') && !versionChanged) {
    Drupal.eu_cookie_compliance.createPopup(drupalSettings.eu_cookie_compliance.popup_html_info, (_euccCurrentStatus !== null));
    $('.eu-cookie-withdraw-tab').click(Drupal.eu_cookie_compliance.toggleWithdrawBanner);
    Drupal.eu_cookie_compliance.attachAgreeEvents();
}

I wonder why the last part of the condition && !versionChanged is included? If it is removed, it fixes the issue ...

if (_euccCurrentStatus === cookieValueDisagreed && drupalSettings.eu_cookie_compliance.settings_tab_enabled && (drupalSettings.eu_cookie_compliance.method === 'opt_in' || drupalSettings.eu_cookie_compliance.method === 'categories')) {
    Drupal.eu_cookie_compliance.createPopup(drupalSettings.eu_cookie_compliance.popup_html_info, (_euccCurrentStatus !== null));
    $('.eu-cookie-withdraw-tab').click(Drupal.eu_cookie_compliance.toggleWithdrawBanner);
    Drupal.eu_cookie_compliance.attachAgreeEvents();
}

So in other words, if:

  • user has rejected cookies
  • and the privacy settings tab is enabled
  • and the compliance method is opt-in or opt-in with categories
  • and cookie agreed version hasn't changed

then the pop-up consent banner is created (but not shown) and the privacy settings tab is present to toggle it. I'll submit a patch if this makes sense.

glugmeister’s picture

Status: Active » Needs review

svenryen made their first commit to this issue’s fork.

  • svenryen committed a9139d7 on 8.x-1.x authored by Glugmeister
    Issue #3305719 by Glugmeister: Privacy settings tab disappears when...
svenryen’s picture

Status: Needs review » Fixed

Makes sense. Thanks for the contribution!

Status: Fixed » Closed (fixed)

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