CRM-12368
authorDonald A. Lobo <lobo@civicrm.org>
Thu, 18 Apr 2013 23:26:33 +0000 (16:26 -0700)
committerDonald A. Lobo <lobo@civicrm.org>
Thu, 18 Apr 2013 23:26:33 +0000 (16:26 -0700)
----------------------------------------
* CRM-12368: proximity search via advanced search broken
  http://issues.civicrm.org/jira/browse/CRM-12368

CRM/Contact/BAO/ProximityQuery.php

index 1cc25cd1b7dda113ee4e42e66c2f0cffe52c9d72..1340c5e91ee2a74e12673a02d8427af9516e56a5 100644 (file)
@@ -331,6 +331,8 @@ $earthDistanceSQL  <= $distance
       CRM_Core_Error::fatal(ts('Proximity searching requires you to set a valid geocoding provider'));
     }
 
+    $query->_tables['civicrm_address'] = $query->_whereTables['civicrm_address'] = 1;
+
     require_once (str_replace('_', DIRECTORY_SEPARATOR, $fnName) . '.php');
     $fnName::format($proximityAddress);
     if (
@@ -345,7 +347,6 @@ $earthDistanceSQL  <= $distance
     }
 
     $query->_qill[$grouping][] = $qill;
-    $query->_tables['civicrm_address'] = $query->_whereTables['civicrm_address'] = 1;
     $query->_where[$grouping][] = self::where(
       $proximityAddress['geo_code_1'],
       $proximityAddress['geo_code_2'],