Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 2.1.5
-
Fix Version/s: Unscheduled
-
Component/s: Core CiviCRM
-
Labels:None
Description
I've been keeping the geocoder disabled most of the time to avoid the huge overhead that it brings. The UpdateAddress.php script is then run nightly to geocode all the new/edited contacts for that day. This almost works really well. The problem being that when an address is edited, the now invalid lat/long are still there.
CiviCRM should set these fields to NULL when an address is saved unless they were explicitly set by the user/API. However this would be incredibly tricky to do. The form processor or API would have to pass an additional parameter, something like 'geo_code_no_reset', further down the chain so that CRM_Core_BAO_Address knows whether or not to reset the lat/long.
In this installation lat/long are never explicitly set so as a workaround I'm currently just using hook_civicrm_pre to always set lat/long to NULL when a contact is edited.