This issue is discussed also in #411360.

When location tries to calculate the latitude & longitude on a location is trying first to geocode with location_latlon_exact() function. This function invoke a web service like Google Maps to obtain the latitude & longitude. If that fails Location is trying to obtain geodata using the postal code through location_get_postalcode_data() function.

The location_get_postalcode_data() call the country-specific include PHP file to have access to that country postal code geodata retrieval.

I found that the country-specific file is not loaded when Location tries to call the function. The attached patch simply adds a call to the location_load_country($location['country']); country loader function.

Comments

claudiu.cristea’s picture

Title: Country not loaded before get postalcode data » Country not loaded before getting postalcode data
claudiu.cristea’s picture

The correct patch is here.

In the above I left a helper function...

bdragon’s picture

Status: Fixed » Closed (fixed)

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