Commit 8e2908bd authored by John Birchall's avatar John Birchall Committed by Sven Berg Ryen
Browse files

Issue #3269129 by John_B: When geolocation, Privacy settings tab still shows for non-GDPR users

parent 7ab1eeaf
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -174,6 +174,7 @@ function eu_cookie_compliance_page_attachments(&$variables) {
  $variables['#attached']['drupalSettings']['eu_cookie_compliance'] = $data['variables'];
  $variables['#attached']['drupalSettings']['eu_cookie_compliance']['open_by_default'] = $open_by_default;
  $variables['#attached']['drupalSettings']['eu_cookie_compliance']['hide_the_banner'] = $hide_the_banner;
  $variables['#attached']['drupalSettings']['eu_cookie_compliance']['geoip_match'] = $geoip_match['in_eu'];
  $variables['#attached']['library'][] = 'eu_cookie_compliance/eu_cookie_compliance_' . ($config->get('use_bare_css') ? 'bare' : 'default');

  // Add javascript.
@@ -534,6 +535,7 @@ function eu_cookie_compliance_build_data() {
    'reload_page'          => !empty($config->get('reload_page')) ? $config->get('reload_page') : FALSE,
    'domain'               => $config->get('domain'),
    'domain_all_sites'     => $config->get('domain_all_sites'),
    'popup_eu_only'        => !empty($config->get('eu_only')) ? $config->get('eu_only') : FALSE,
    'popup_eu_only_js'     => !empty($config->get('eu_only_js')) ? $config->get('eu_only_js') : FALSE,
    'cookie_lifetime'      => $config->get('cookie_lifetime'),
    'cookie_session'       => $config->get('cookie_session'),
+6 −0
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@
                // If not in EU, set an agreed cookie automatically.
                else {
                  Drupal.eu_cookie_compliance.setStatus(cookieValueAgreed);
                  // Set the geoip_match to false so it can be used elsewhere.
                  drupalSettings.eu_cookie_compliance.geoip_match = false;
                  // Also set all the categories as agreed if applicable, and load
                  // scripts.
                  if (drupalSettings.eu_cookie_compliance.method === 'categories') {
@@ -107,6 +109,10 @@
        Drupal.eu_cookie_compliance.setVersion("unknown");
      }

      if (drupalSettings.eu_cookie_compliance.popup_eu_only === true && drupalSettings.eu_cookie_compliance.geoip_match !== true) {
        return;
      }

      var versionChanged = Drupal.eu_cookie_compliance.getVersion() !== drupalSettings.eu_cookie_compliance.cookie_policy_version;

      // Closed if status has a value and the version hasn't changed or user has not agreed.