Problem/Motivation

When trying to disable a JavaScript by category EU Cookie Compliance messes with the URL.

Steps to reproduce

Consent method: Opt-in with categories. Let visitors choose which cookie categories they want to opt-in for (GDPR compliant).

Create a Cookie category:
disqus|Usability cookies

Disable JavaScripts:
disqus:sites/all/modules/disqus/disqus.js

When not accepting the "Usability cookies" category EU Cookie Compliance doesn't find resource: /disqus%3Asites/all/modules/disqus/disqus.js

Proposed resolution

Category name shouldn't be appended to disabled JavaScript URL. The resource should be correctly sites/all/modules/disqus/disqus.js (without the category tag included)

Remaining tasks

User interface changes

API changes

Data model changes

Comments

slampy created an issue. See original summary.

svenryen’s picture

@slampy would you be able to test the current -dev build? It should be stable enough, we're already using it on a few sites.
I think we have solved this bug already.

Let me know how it works. Thanks!

svenryen’s picture

Assigned: Unassigned » svenryen
svenryen’s picture

@slampy, which browser are you using? And which version of php?

I believe this was fixed in #3115531: Disabled JS does not load after consent., but looking at that issue now, it seems we fixed the opposite condition; strings not being URL encoded.

It seems that in your case, the setting string was url encoded.

svenryen’s picture

Status: Active » Needs review

I'm attempting a stab in the dark here, can you apply this patch and see if it fixes your issue?

svenryen’s picture

neslee canil pinto’s picture

Version: 7.x-1.32 » 7.x-1.x-dev
slampy’s picture

I have upgraded to 7.x-1.x-dev. The error has gone but it looks like the js files are still loaded (even after refresh).

What is the correct format to block a JS?
1, disqus:sites/all/modules/disqus/disqus.js
2, disqus:public://sites/all/modules/disqus/disqus.js
3, disqus:modules/disqus/disqus.js
4, disqus:public://sites/all/modules/disqus/disqus.js

How can I check if the JS is blocked? It still shows up in the source code under Chrome DevTools.

svenryen’s picture

Unfortunately, with the way disqus.js is added in their module, you can't use the feature in EU Cookie Compliance to prevent that script from loading.

svenryen’s picture

Not sure if there are any test steps for this one, you can probably just do a review by reading the code and then just checking that we don't break any related functionality by applying this patch.

neslee canil pinto’s picture

Status: Needs review » Needs work

Patch needs a reroll

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   784  100   784    0     0    451      0  0:00:01  0:00:01 --:--:--   451
error: patch failed: eu_cookie_compliance.admin.inc:953
error: eu_cookie_compliance.admin.inc: patch does not apply
svenryen’s picture

neslee canil pinto’s picture

Assigned: neslee canil pinto » Unassigned
Status: Needs work » Fixed

Committed to dev branch. Thank you.

  • svenryen committed 062e4fb on 7.x-2.x
    Merge branch '7.x-1.x' into 7.x-2.x
    
    * 7.x-1.x:
      Issue #3175031 by...
  • Neslee Canil Pinto committed a4a5870 on 7.x-2.x authored by svenryen
    Issue #3171654 by svenryen: Disable JavaScripts by category doesn't work...

Status: Fixed » Closed (fixed)

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