Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-19977

Update all fields manipulated by hook_civicrm_geocoderFormat when geocoding

    Details

    • Versioning Impact:
      Minor (add functionality in backwards-compatible manner)
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code
    • Verified?:
      No

      Description

      The geocoders (CRM_Utils_Geocode_Google and CRM_Utils_Geocode_Yahoo) have a hook "hook_civicrm_geocoderFormat" which allows an extension to manipulate the address object during geocoding.

      Unfortunately, the current CRM_Utils_Address_BatchUpdate->processContacts, which calls the geocode method, will only update a few fields after the geocoding and hook processing are complete :

      • geo_code_1
      • geo_code_2
      • postal_code
      • postal_code_suffix

      If the extension using the hook modifies any other fields, the new values are being discarded by CRM_Utils_Address_BatchUpdate->processContacts.

      This improvement would allow other fields to also be updated if they have been manipulated by the geocoder / hook function :

      • city
      • county_id
      • state_province_id
      • country_id
      • street_name
      • street_number
      • street_unit

      PR 9794 has been submitted for this.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Mathieu Mathieu
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 30 minutes
                30m
                Remaining:
                Remaining Estimate - 30 minutes
                30m
                Logged:
                Time Spent - Not Specified
                Not Specified