Skip to content

Commit

Permalink
Moved updating manual_geocode field to 1 codes to old line 214
Browse files Browse the repository at this point in the history
  • Loading branch information
pipeline authored and monishdeb committed Nov 1, 2023
1 parent 1456d91 commit bb6526c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions CRM/Utils/Address/BatchUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function processContacts($processGeocode, $parseStreetAddress) {
$dao = CRM_Core_DAO::executeQuery($query, $params);

$unparseableContactAddress = [];

while ($dao->fetch()) {
$totalAddresses++;
$params = [
Expand Down Expand Up @@ -216,6 +216,12 @@ public function processContacts($processGeocode, $parseStreetAddress) {
$totalGeocoded++;
$addressParams = $params;
}
else {
// If an address has failed in the geocoding scheduled job i.e. no lat/long is fetched, we will update the manual_geocode field to 1.
$addressParams['manual_geo_code'] = TRUE;
$addressParams['geo_code_1'] = 0;
$addressParams['geo_code_2'] = 0;
}
}

// parse street address
Expand All @@ -226,12 +232,7 @@ public function processContacts($processGeocode, $parseStreetAddress) {
// when we should found street_number and street_name
if (empty($parsedFields['street_name']) || empty($parsedFields['street_number'])) {
$success = FALSE;
// If an address has failed in the geocoding scheduled job i.e. no lat/long is fetched, we will update the manual_geocode field to 1.
$addressParams['manual_geo_code'] = TRUE;
$addressParams['geo_code_1'] = 0;
$addressParams['geo_code_2'] = 0;
}

// do check for all elements.
if ($success) {
$totalAddressParsed++;
Expand Down Expand Up @@ -275,7 +276,7 @@ public function processContacts($processGeocode, $parseStreetAddress) {
}
}
}

return $this->returnResult();
}

Expand Down

0 comments on commit bb6526c

Please sign in to comment.