From: Brian Shaughnessy Date: Tue, 3 May 2022 18:59:56 +0000 (-0400) Subject: dev/core#3439 change batch geocode query to include events X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=aaa95afe261fab94d5968e4ef8bc0d1a74b03656;p=civicrm-core.git dev/core#3439 change batch geocode query to include events --- diff --git a/CRM/Utils/Address/BatchUpdate.php b/CRM/Utils/Address/BatchUpdate.php index 22177485f3..d26d35941b 100644 --- a/CRM/Utils/Address/BatchUpdate.php +++ b/CRM/Utils/Address/BatchUpdate.php @@ -116,7 +116,7 @@ class CRM_Utils_Address_BatchUpdate { */ public function processContacts($processGeocode, $parseStreetAddress) { // build where clause. - $clause = ['( c.id = a.contact_id )']; + $clause = []; $params = []; if ($this->start) { $clause[] = "( c.id >= %1 )"; @@ -137,19 +137,22 @@ class CRM_Utils_Address_BatchUpdate { $whereClause = implode(' AND ', $clause); $query = " - SELECT c.id, - a.id as address_id, - a.street_address, - a.city, - a.postal_code, - a.country_id, - s.name as state, - o.name as country - FROM civicrm_contact c - INNER JOIN civicrm_address a ON a.contact_id = c.id - LEFT JOIN civicrm_country o ON a.country_id = o.id - LEFT JOIN civicrm_state_province s ON a.state_province_id = s.id - WHERE {$whereClause} + SELECT c.id, + a.id as address_id, + a.street_address, + a.city, + a.postal_code, + a.country_id, + s.name as state, + o.name as country + FROM civicrm_address a + LEFT JOIN civicrm_contact c + ON a.contact_id = c.id + LEFT JOIN civicrm_country o + ON a.country_id = o.id + LEFT JOIN civicrm_state_province s + ON a.state_province_id = s.id + WHERE {$whereClause} ORDER BY a.id ";