Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We need to pass the api key of the active plugins as per geocoder latest update. See readme.txt .
$addressCollection = \Drupal::service('geocoder')->geocode($address, $plugins, $options);
Options contains api key and other required configuration. Without api key you will get an error Daily quota exceeded, sometimes it successfully geocode the address even if you don't pass any api key. Google might allow only 2-3 times without an api key. Check here http://maps.googleapis.com/maps/api/geocode/json?address=Hogansville%2C%... and refresh 2-3 times. You will get an error.
Comment | File | Size | Author |
---|---|---|---|
#14 | interdiff.txt | 3.48 KB | mollux |
#14 | search_api_location-2954999-14-api-key.patch | 3.02 KB | mollux |
Comments
Comment #2
dbjpanda CreditAttribution: dbjpanda commentedFixed the error and adjusted some coding standard issue.
Comment #3
nicrodgersRan in to exactly the same problem, spent ages debugging it, came to the same conclusion as you, wrote a patch, came here to upload it... then found this patch was already here :-D
thanks, applies cleanly and solves the problem.
RTBC but leaving it as needs review until the tests have run/passed.
Comment #4
dbjpanda CreditAttribution: dbjpanda commented@nicrodgers Test fails due to some issue in Recursive prefix data type and a part of rpt_map_widget module. We may open another issue for this.
Comment #5
dbjpanda CreditAttribution: dbjpanda commentedComment #6
borisson_The coding standards in the patch are not following the drupal coding standards, everything seems to be intented with 4 spaces instead of 2. We should fix that.
Comment #7
ankitjain28may CreditAttribution: ankitjain28may as a volunteer and at Google Summer of Code commentedFix Coding standard for the above patch and for other files too, Added interdiff. Please review.
Comment #8
nicrodgersTo keep things simple, I'd suggest the patch for this issue should only address the issue described in the summary. Raise follow-ups for any coding standard issues instead of trying to fix them here.
Comment #9
dbjpanda CreditAttribution: dbjpanda commentedSearch_api_location.Drupal\Tests\search_api_location_geocoder\Kernel\GeocodeTest error should be addressed in the patch.
Comment #10
ankitjain28may CreditAttribution: ankitjain28may as a volunteer and at Google Summer of Code commented@nicrodgers Sure, I will make another patch. Thanks.
Comment #11
ankitjain28may CreditAttribution: ankitjain28may as a volunteer and at Google Summer of Code commentedInterdiff and patch for the above stated issue.
Comment #13
ankitjain28may CreditAttribution: ankitjain28may as a volunteer and at Google Summer of Code commentedI am getting this error while running Kernel tests, I tried installing packages using composer but still getting the same error.
Even other plugins like 'geoId' is also not found.
Do i need to install any other packages ?
Comment #14
mollux CreditAttribution: mollux as a volunteer commented@ankitjain28may, not sure what the issue with the tests is, I was able to run them without problem.
I rerolled the patch and used dependency injection to load the geocoder config.
It is also not necessary to filter the config for the active plugin, the Geocoder module doesn't do that either, see e.g.
GeocodeFormatterBase::viewElements
Comment #15
borisson_Changes here look very solid.
Comment #16
GeorgeBC CreditAttribution: GeorgeBC commentedTested this and works exactly as designed. Thank you!
Comment #17
jigariusI was about to submit a patch but I found this one. Works for me. Thanks!
However, I believe this is more of an issue with the Geocoder module. It should be aware of its configuration.
Comment #19
mollux CreditAttribution: mollux at Dropsolid commentedThanks for the feedback.
Committed!