Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Incomplete
-
Affects Version/s: 4.1.2, 4.6.24, 4.7.14
-
Fix Version/s: None
-
Component/s: Core CiviCRM
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Needs Funding
Description
When running the cron for geocoding it will not notify when it has hit the query limit.
Also, if it hits the query limit with thousands more contact records to go... it'll keep sending requests to Google for to geocode addresses, every time getting the OVER_QUERY_LIMIT response. This could be handled better.
The idea is to get rid of the eval() in BatchUpdate.php, or at least fall back to it, and check the return value. If the return value of a geocoding request was OVER_QUERY_LIMIT then we'll exit the loop so we don't hit Google's servers (potentially thousands of times for the remaining contacts) and always get OVER_QUERY_LIMIT back.
For this I set up some consts at the beginning of the Google.php geocoding class and return those, because true and false didn't cut it anymore.
The formatting function for geocoding addresses is called from a couple of other places, but the return value is never checked so there's no problem there.
krimson@hbddc1093:/home/prod_ienet/default_www/sites/all/modules/contrib/civicrm/CRM$ grep -R ".geo.::format(" *
Contact/BAO/ProximityQuery.php: eval( $config->geocodeMethod . '::format( $proximityAddress );' );
Core/BAO/Address.php: eval( $config->geocodeMethod . '::format( $params );' );
Utils/Address/BatchUpdate.php: $geocodingResult = CRM_Utils_Geocode_Google::format($params, true);
Utils/Address/BatchUpdate.php: eval( $config->geocodeMethod . '::format( $params, true );' );
I've added BatchUpdate.php and Google.php with the new code.
Attachments
Issue Links
- is supplemented by
-
CRM-18830 Google Geocoding - use SSL, restore API key
- Done/Fixed