Hello,
First let me say I'm new with Drupal and web dev in general.

My issue is : in withdraw section, the 3 boxes are checked (activate tab, enable floating, put the withdraw consent button) but the withdraw button is not visible in the tab. Only the 'accept all' button is there.

I'm in Drupal 9.3.2

Did I miss anything ?

Thanks in advance.
Lucky.

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

Lucky723 created an issue. See original summary.

elber’s picture

Issue summary: View changes

Hello could you to say what file is the issue? Thank you

svenryen’s picture

Hi Lucky, and thanks for your report.

This could be a bug. If you uncheck the "Put the "Withdraw consent" button on the cookie information banner." checkbox, there's a withdraw button, but the rest of the banner is hidden.

I won't be able to look into this till the weekend.
Patches are also welcome.

lucky723’s picture

Hi,
@elber, no idea sorry
@svenryen, if I uncheck "Put the "Withdraw consent" button on the cookie information banner.", the message in the banner says the cookies have been accepted, and the withdraw button is there (the tab also disappears). If I click the withdraw button, then the banner gives again the choice to select/unselect categories.
Btw I forgot to say I use the option "Opt-in with categories. Let visitors choose which cookie categories they want to opt-in for (GDPR compliant)."

Am I right if I say, considering the options I chose, that both accept and withdraw buttons should appear side to side on the right of the banner, and the categories on the left ?

Thanks.

svenryen’s picture

Am I right if I say, considering the options I chose, that both accept and withdraw buttons should appear side to side on the right of the banner, and the categories on the left ?

Yes, that's the correct assumption. I think we had the button there when the feature was originally set up, but somewhere along the line the bug snuck in.

ambient.impact’s picture

@svenryen I think I've spotted the problem: the withdraw button is given the visually-hidden class but the JavaScript tries to show it using jQuery .show() method, which I'm pretty sure doesn't know about that class so that's why it's not showing up.

ambient.impact’s picture

Status: Active » Needs review

Threw together a quick fix that removes the visually-hidden class rather than calling .show().

Note that this doesn't fix the following, as it might be unrelated:

This could be a bug. If you uncheck the "Put the "Withdraw consent" button on the cookie information banner." checkbox, there's a withdraw button, but the rest of the banner is hidden.

lucky723’s picture

Hello,

@Ambient.Impact, I've applied your proposal merge request !49

First in my version of js/eu_cookie_compliance.js (8.x-1.19), in the lines 160 and 464,
I don't have :
if (_euccCurrentStatus === cookieValueAgreedShowThankYou || _euccCurrentStatus === cookieValueAgreed) {
but :
if (_euccCurrentStatus === 1 || _euccCurrentStatus === 2) {

I've changed lines 161 and 465 as you suggest, indeed the withdraw button appears if 1 type of optional cookies at least is checked.
Since I want it to be always there, I've removed the condition above.

At the end I have :

158 if (drupalSettings.eu_cookie_compliance.withdraw_enabled) {
159 Drupal.eu_cookie_compliance.attachWithdrawEvents();
160 // if (_euccCurrentStatus === 1 || _euccCurrentStatus === 2) {
161 $('.eu-cookie-withdraw-button').removeClass('visually-hidden');
162 //}
163 }
164 }

462 if (drupalSettings.eu_cookie_compliance.withdraw_enabled && drupalSettings.eu_cookie_compliance.withdraw_button_on_info_popup) {
463 Drupal.eu_cookie_compliance.attachWithdrawEvents();
464 // if (_euccCurrentStatus === 1 || _euccCurrentStatus === 2) {
465 $('.eu-cookie-withdraw-button').removeClass('visually-hidden');
466 // }
467 }

And it works.

Is it a good method ?

Thanks.

ambient.impact’s picture

@Lucky723 Regarding your two questions:

  1. My merge request won't apply to the stable release because it's against the latest dev, which contains changes made after that stable release. That's why the lines don't match for you. If you apply the merge request from #3254209: Changing cookie policy version will mean the banner can never be dismissed which changes those lines before this one, it applies without errors.
  2. I'm honestly not familiar enough with the code of this module, and just needed a quick fix for this. In all likelihood, we'll be switching to something else on the project I use it on (Omnipedia); see this comment on #3130662-31: Roadmap to 2.0.x release.
pasperbla’s picture

I have created a patch that I share with everyone and that solves the problem.

ambient.impact’s picture

StatusFileSize
new38.27 KB

@pasperbla While I appreciate your contribution, there's already a merge request open for exactly those changes and a patch available from that merge request:

A screenshot of this issue summary's merge request patch link.

swarad07’s picture

I can confirm that for 1.19 we do need both patches, the order should be,
1. Patch from #3254209: Changing cookie policy version will mean the banner can never be dismissed
2. Patch from this issue's MR -> https://git.drupalcode.org/project/eu-cookie-compliance/-/merge_requests/49

#2 only works if 1 is applied first.

svenryen’s picture

Status: Needs review » Reviewed & tested by the community

svenryen’s picture

Status: Reviewed & tested by the community » Fixed

Merged! Thanks for the contribution!

Status: Fixed » Closed (fixed)

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