doublesecretagency / craft-googlemaps

Google Maps plugin for Craft CMS - Maps in minutes. Powered by the Google Maps API.
https://plugins.doublesecretagency.com/google-maps/
Other
10 stars 8 forks source link

MaxMind geolocation API fails when using GeoIP2 Country #87

Closed amphibian closed 1 year ago

amphibian commented 1 year ago

Hey folks - when using the geolocation feature via MaxMind, and setting the GeoIP2 Service to GeoIP2 Country, the API call fails (error returned is "Unable to parse MaxMind API response.")

This is because in your MaxMind model's _parseResponse method, you're making $response[location'] a required response key in determining success, but that key is only returned when using the GeoIP2 City service.

Removing the explicit check for $response[location'] fixes the issue.

(It looks like MaxMind does have a composer package available now, just FYI.)

lindseydiloreto commented 1 year ago

Thanks for reporting! This is now fixed on the v4-dev branch.

To test it out before the next release, change the plugin version specified in composer.json...

"doublesecretagency/craft-googlemaps": "dev-v4-dev"

Then run composer update.

Let me know if that does the trick!

lindseydiloreto commented 1 year ago

This fix has been officially released in 4.3.5. 👍

amphibian commented 1 year ago

Excellent, thanks Lindsey.