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

  1. Configure an Authentication-type key file containing a Google Maps API key
  2. Configure Geolocation Google Maps Settings to use a key file machine name
  3. Configure a Geolocation field to pull from the address field with the Geolocation Google Maps API - Geocoding and Map field widget.
  4. On the configured node/block/etc, populate the address field.
  5. 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

AnaliaMok created an issue. See original summary.

analiam319@gmail.com’s picture

StatusFileSize
new1.03 KB
christianadamski’s picture

Status: Active » Needs review

  • AnaliaMok authored c6b5d7c on 8.x-3.x
    Issue #3217047 by AnaliaMok: Missing Key Module Support For Geocoding...
christianadamski’s picture

Status: Needs review » Fixed

Thanks

Status: Fixed » Closed (fixed)

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