Commit 0166a84e authored by Sven Berg Ryen's avatar Sven Berg Ryen Committed by Sven Berg Ryen
Browse files

Issue #3314374 by svenryen: Smart IP fails to get the country code

parent 05c2b4db
Loading
Loading
Loading
Loading
+2 −0
Changes for eu_cookie_compliance.module: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Asset\AttachedAssetsInterface;
use Drupal\Component\Utility\Xss;
use Drupal\eu_cookie_compliance\PersonalInformationFormInterface;
use Drupal\smart_ip\SmartIp;

/**
 * Implements hook_help().
@@ -789,6 +790,7 @@ function eu_cookie_compliance_user_in_eu() {
  if (\Drupal::moduleHandler()->moduleExists('smart_ip')) {
    /** @var \Drupal\smart_ip\SmartIpLocation $location_service */
    $location_service = \Drupal::service('smart_ip.smart_ip_location');
    SmartIp::query($ip_address);
    $country_code = $location_service->get('countryCode');
  }
  // Try to get country_code by geoip module.