Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently the popup shows on admin pages and on the overlay (so you get 2 on 1 page). I think there should be an option to hide it on admin pages, optionally hide for registered users (who may consent through their registration form), and hide on overlays.
Comment | File | Size | Author |
---|---|---|---|
#6 | Use-path_is_admin-to-hide-on-admin-pages-and-add-exclude-path-field-1682828-6.patch | 1.76 KB | __cj |
Comments
Comment #1
Homotechsual CreditAttribution: Homotechsual commentedI agree that this is necessary, this should not be considered so much of a "feature request" as a bug report as there is no reason to display this to logged in users or administrators.
Comment #2
buddaNot displaying to logged in users could be a tricky situation -- as a user may already be logged in before this module is added, and thus would never see the pop-up and consent information provided.
Comment #3
buddaThere's already code in the module to not render the icon/pop-up on admin pages.
if (strpos(current_path(), 'admin') === FALSE) {
Comment #4
buddaI have seen the problem with things like lightbox.
Not come up with a solution to that yet.
Comment #5
__cj CreditAttribution: __cj commentedThe attached patch makes use of path_is_admin (http://api.drupal.org/api/drupal/includes%21path.inc/function/path_is_ad...), instead of checking if 'admin' is in the current path. This fixes the problem with it displaying on '/node/add' or '/node/edit/*', and other administration pages.
This doesn't solve the problem of it displaying in lightboxs though.
Chris.
Comment #6
__cj CreditAttribution: __cj commentedThe attached patch builds on the previous patch.
It adds a field to the admin page - 'Exclude Paths', in which you can add a list of paths to hide the cookie control on.
My specific use case is the cookie control is displaying in the media module's dialog iframe, (the media module doesn't declare it as an admin page), but I'm sure there are other pages where you'd want to hide it (perhaps when using the print module).
Chris.
Comment #7
__cj CreditAttribution: __cj commentedComment #8
Peacog CreditAttribution: Peacog commentedI've applied #6 and it works for me. Thank you!
Comment #9
Homotechsual CreditAttribution: Homotechsual commentedConfirming number 6 works here too. On all 10 drupal sites, across 5 different servers, 3 different OS's and all with slightly different configs. :-p
Thanks for the patch! __cj :-)
Marking as RBTC for now.
Comment #10
buddaThanks __cj committed.
Comment #11
Homotechsual CreditAttribution: Homotechsual commentedBudda - any idea when we'll see a release with this patch included?
Comment #12
budda@MJCO - the 1.6 release which was rolled out on 25th feb included it.