diff --git a/plugins/UserCountry/LocationProvider.php b/plugins/UserCountry/LocationProvider.php index a364615338543883b6f93cd4ceea416783aae552..3f6b8821ed29fc2df43bbce75e721083ab4ef020 100755 --- a/plugins/UserCountry/LocationProvider.php +++ b/plugins/UserCountry/LocationProvider.php @@ -300,6 +300,7 @@ abstract class Piwik_UserCountry_LocationProvider "Invalid provider ID '$providerId'. The provider either does not exist or is not available"); } Piwik_SetOption(self::CURRENT_PROVIDER_OPTION_NAME, $providerId); + Piwik_Tracker_Cache::clearCacheGeneral(); return $provider; } diff --git a/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php b/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php index 2ab755e75faa051f16c01eeee762e06e8ffd4c5e..9185998624052313bbb068375f4de3c20a377208 100755 --- a/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php +++ b/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php @@ -203,6 +203,11 @@ class Test_Piwik_Integration_ManyVisitorsOneWebsiteTest extends IntegrationTestC Piwik_UserCountry_LocationProvider::$providers = null; Piwik_UserCountry_LocationProvider::setCurrentProvider(self::GEOIP_IMPL_TO_TEST); + if (Piwik_UserCountry_LocationProvider::getCurrentProviderId() !== self::GEOIP_IMPL_TO_TEST) + { + throw new Exception("Failed to set the current location provider to '".self::GEOIP_IMPL_TO_TEST."'."); + } + $possibleFiles = Piwik_UserCountry_LocationProvider_GeoIp::$dbNames['loc']; if (Piwik_UserCountry_LocationProvider_GeoIp::getPathToGeoIpDatabase($possibleFiles) === false) {