Problem/Motivation

We are geolocating using Smart IP. This works. The banner shows in GDPR countries but not in non-GDPR countries. However, in non-GDPR countries the Privacy Settings tab does show. I think it should not, and that this is a bug.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

John_B created an issue. See original summary.

john_b’s picture

Here is a patch. The approach is to add two new settings to drupalSettings, for popup_eu_only and for geoip_match. If popup_eu_only OR popup_eu_only_js are true, AND geoip_match is not true, return nothing from the JS execute() function.

On D9 I still have problems with caching on a non-Varnish site (reported for D7 at #3261155: We sometimes hit the cache before getting geographic location), and I am inclined to think the non-JS option should be removed. However, that is a separate issue. Provided drupalSettings are returning correct value for geoip_match, my patch is working for me.

svenryen’s picture

Status: Active » Needs review
svenryen’s picture

Status: Needs review » Needs work

I had a look at the patch. It seems to make the new geoip_match setting part of the page source code (the value will be output along drupalSettings). This means the patch won't work on cached pages, and might drop the banner for some people that should have seen the banner, it might even be inconsistent, depending on the country of the visitor that caused the cache to be created visited from.

Also, the array returned from eu_cookie_compliance_build_data() is cached once per theme/language/domain combination, which adds to the likelihood this patch will break on a site that gets frequent visitors from around the world.

I'll see if I can come up with a different approach that does work with cached pages, but I'll wait till the big patch in #3243001: Banner at top is not hiding correctly is merged, otherwise we'll probably have to re-roll the patch for this issue.

  • svenryen committed 8e2908b on 8.x-1.x authored by John_B
    Issue #3269129 by John_B: When geolocation, Privacy settings tab still...
svenryen’s picture

I modified the patch a bit and changed it so that the geoip_match variable isn't cached in the database. Seems to work well now.

Status: Fixed » Closed (fixed)

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