Closed (fixed)
Project:
EU Cookie Compliance (GDPR Compliance)
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
20 Apr 2018 at 08:52 UTC
Updated:
3 Jun 2018 at 14:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dragos-dumi commentedComment #3
svenryen commentedThanks for the patch. I have a question. From what I understand we change module weight so that hooks run after other modules have added their scripts. What happens if another module has weight 1, weight 0 or weight -1 (or lower) and that module defines a javascript?
Comment #4
dragos-dumi commentedThat's a valid point. Since most of the modules comes with weight 0, this should work for most cases.
Maybe as an improvement we could add in the config screen a notice about this, that the developer might need to adjust the weight.
What do you think?
Comment #5
svenryen commentedIt would be great if it can also happen automatically.
How about if we loop through the weights of all other modules and sets the weight of this module higher than the current highest?
And in addition to that, instead of the proposed field, can we have a button that when clicked makes sure the weight of this module is the highest again (presuming they've installed some other module that for example has the weight of 1000 after they installed EU cookie compliance?) If the process is not automated for the user, they would have to inspect all relevant modules to see what's the currently highest value, which would be a pain.
Comment #6
svenryen commentedComment #7
svenryen commentedComment #8
svenryen commentedHere is an updated patch that also checks the weight of other modules and makes this module load at the end, adding an exclusion list for modules that are allowed to have higher weight (for #2933614: [2.x?] How to block cookies until the user accepts, for example Google Analytics cookies? we need to let google_analytics load after this module). For now, Google Analytics is added to the exclusion list, and we should be able to add other modules to the exclusion list later, when needed.
The weight is reset every time the config form is saved, addressing the issue where a module with higher weight is added after this module is installed.
Comment #9
svenryen commented