Google Maps geocoding is not working - the API key is set in the config but does not get passed correctly in CRM_Utils_geocode_Geocode::getProviderClass()
Issue 1) The argument string of 'geocoder.api_key' gets looked up in getProviderArgument() and then again in getProviderClass() It looks like functionality may have been intended to move from one function to the other, but is duplicated. Removing the if (is_string($argument).....) and always returning $argument resolves this for Google but I don't know whether any other providers would be adversely affected by that change.
Issue 2) As shown in the google-maps-provider example, the API key needs to be the second parameter with the first one (region) being null (or set to a region). The current options for the structure of 'argument' don't allow a first null parameter to be set.
Google Maps geocoding is not working - the API key is set in the config but does not get passed correctly in
CRM_Utils_geocode_Geocode::getProviderClass()
Issue 1) The argument string of 'geocoder.api_key' gets looked up in
getProviderArgument()
and then again ingetProviderClass()
It looks like functionality may have been intended to move from one function to the other, but is duplicated. Removing theif (is_string($argument).....)
and always returning$argument
resolves this for Google but I don't know whether any other providers would be adversely affected by that change.Issue 2) As shown in the google-maps-provider example, the API key needs to be the second parameter with the first one (region) being
null
(or set to a region). The current options for the structure of 'argument' don't allow a firstnull
parameter to be set.Tested on current master.