Closed (fixed)
Project:
EU Cookie Compliance (GDPR Compliance)
Version:
7.x-1.32
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Aug 2020 at 11:56 UTC
Updated:
24 Sep 2020 at 19:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
john_b commentedIn hook_js_alter() the line
_eu_cookie_compliance_convert_relative_uri($script);
has the opposite affect, and by converting relative paths to absolute ones prevents local JS tags from being unset.
Comment #3
john_b commentedComment #4
svenryen commentedHi @John_B! Nice catch. This was actually fixed in 8.x-1.x, but got never carried over to 7.x-1.x.
The attached patch should fix the problem.
Comment #5
john_b commentedSorry, the patch does not fix the problem.
As per my comment #2,
_eu_cookie_compliance_convert_relative_uri($script);is still running and converting relative paths to absolute ones, so relative paths do not get unset.In addition, absolute paths are still getting converted to relative paths.
Suggestion:
1. remove
_eu_cookie_compliance_convert_relative_uri($script);-- I am not sure what is there for?2. to prevent the absolute links losing the protocol part before the :, this works, though not elegant:
Comment #6
svenryen commentedJohn B, what's the input that you use for the disabled scripts?
I tried
key1:https://ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.min.js, and I was successfully able to disable this script in 7.x.With regards to [1], if we remove that line, we might have regressions.
Comment #7
john_b commentedWhat you say is correct. However, your patch does not work where there is no category.
In other words, your patch works for:
key1:https://ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.min.jsbut does not work for:
https://ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.min.js.With regards to [1], we still need a fix. For example I am loading
sites/all/modules/custom/my_custom_module/js/intercom.jsIf in the config form I add
sites/all/modules/custom/my_custom_module/js/intercom.jsor
key1:sites/all/modules/custom/my_custom_module/js/intercom.jsthe value of $script, after that function runs, is set to
https://example.com/sites/all/modules/custom/my_custom_module/js/intercom.js(where example.com is my $base_url). The script, because it has a relative path is not blocked.
Comment #8
svenryen commentedThanks. Will look into cases when there's no category later today.
Comment #9
svenryen commentedComment #10
svenryen commentedThanks for your input.
My IDE barfs at this line:
$script = $script;If you agree, can we commit this instead?
It should give the same result.
I also found another related bug, so here's an updated patch.
Would be great if you can review, John_B.
Comment #11
svenryen commentedComment #12
neslee canil pinto1. First i did checked this functionality working for 8.x branch with the latest dev version.
2. As @John_B had pointed out in #7 which is what how it should act. +1 on that scenario.
@svenryen yes, i agree on your latest patch and the new catch too. I think this is ready to commit into 7.x.
Comment #13
john_b commentedSorry to have been absent. This project was on the backburner, & I was busy on other things. Since it is marked RTBC, it only remains to say thanks @svenryen and @Neslee Canil Pinto for work on this.
Comment #14
neslee canil pinto@John_B did you had a look at the latest patch submitted by @svenryen. I did check it with your scenario at it did work for me
Comment #16
neslee canil pintoCommitted to dev branch.