Problem/Motivation
After configuring the Geolocation Google Maps Settings to use a key file from the Key module, executing a geocode request fails due to an invalid API key. Seems to be caused by missing KeyProvider call when retrieving config values in GoogleGeocodingAPI::geocode.
Steps to reproduce
- Configure an Authentication-type key file containing a Google Maps API key
- Configure Geolocation Google Maps Settings to use a key file machine name
- Configure a Geolocation field to pull from the address field with the Geolocation Google Maps API - Geocoding and Map field widget.
- On the configured node/block/etc, populate the address field.
- Then on the Google Map preview, pull the address for geocoding.
Currently, results in an invalid API key error message.
error: "The provided API key is invalid.". Request URL: https://maps.googleapis.com/maps/api/geocode/json
Proposed resolution
Adjust the GoogleGeocodingAPI::geocode method to use the KeyProvider::getKeyValue method when retrieving config values.
Comments
Comment #2
analiam319@gmail.com commentedComment #3
christianadamski commentedComment #5
christianadamski commentedThanks