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.
It would be nice if other modules could alter the values before geocoder attempts to geocode them.
This patch adds a drupal_alter hook which does just that.
Comment | File | Size | Author |
---|---|---|---|
#7 | 1996592-geocoder_geocode_values-6.patch | 1.15 KB | _wdm_ |
#5 | 1996592-geocoder_geocode_values-5.patch | 698 bytes | Robert_W |
#1 | 1996592-geocoder_geocode_values.patch | 605 bytes | beeradb |
Comments
Comment #1
beeradb CreditAttribution: beeradb commentedComment #2
beeradb CreditAttribution: beeradb commentedComment #3
Brandonian CreditAttribution: Brandonian commentedThanks for the patch, @beeradb. Looks good, committed.
http://drupal.org/commitlog/commit/27950/8e531f4dc6a8224a9dac978397fbfba...
Comment #5
Robert_W CreditAttribution: Robert_W commentedThe patch works, but I had to combine several fields of the entity before geocoding them. The current patch doesn't give you access to the entity object, so I modified the patch to include the entity object so that you can access fields other than the source field.
I created the patch from the 7.x-1.2 version (latest stable at the moment) because that's the version I'm working with.
Comment #6
Robert_W CreditAttribution: Robert_W commentedComment #7
_wdm_ CreditAttribution: _wdm_ commentedIt also seems like a good idea to have a hook in the geocoder function.
Comment #8
rudiedirkx CreditAttribution: rudiedirkx commentedI know nothing about the geocoder() function (or its alter), because I've never used it.
I think the
geocoder_geocode_values
alter is 'wrong', because if you need the entity, you should make your own virtual encodable field. That's why #2159925: Geocode from virtual fields/entity property instead of just real fields exists.@_wdm_ You should probably create a new issue for that alter.
Comment #10
PolComment #11
AdamPS CreditAttribution: AdamPS commentedIt looks to me like the issue was fixed and the wrong status was picked by mistake.