CRM-14424 fix - Wrong parameters for geocoding batch
authormonishdeb <monish.deb@webaccess.co.in>
Tue, 13 May 2014 07:56:19 +0000 (13:26 +0530)
committermonishdeb <monish.deb@webaccess.co.in>
Tue, 13 May 2014 07:56:19 +0000 (13:26 +0530)
https://issues.civicrm.org/jira/browse/CRM-14424

CRM/Admin/Form/Job.php
CRM/Utils/Address/BatchUpdate.php

index 69432ed836229a457bb6aff1549676abcd387e41..801629f2079800e1b9f0428bc933f2ff8d1643a2 100644 (file)
@@ -116,7 +116,7 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form {
 
     /** @var \Civi\API\Kernel $apiKernel */
     $apiKernel = \Civi\Core\Container::singleton()->get('civi_api_kernel');
-    $apiRequest = $apiKernel->createRequest($fields['api_entity'], $fields['api_action'], array('version' => 3), NULL);
+    $apiRequest = \Civi\API\Request::create($fields['api_entity'], $fields['api_action'], array('version' => 3), NULL);
     try {
       $apiKernel->resolve($apiRequest);
     } catch (\Civi\API\Exception\NotImplementedException $e) {
index 81425f66c32320bfcf6ff4d2f96a76df06db0252..49a8903c18ea1f452ef0c27982f3a8fb47a0600b 100644 (file)
@@ -59,7 +59,7 @@ class CRM_Utils_Address_BatchUpdate {
     // do check for geocoding.
     $processGeocode = FALSE;
     if (empty($config->geocodeMethod)) {
-      if ($this->geocoding == 'true') {
+      if (CRM_Utils_String::strtobool($this->geocoding) === TRUE) {
         $this->returnMessages[] = ts('Error: You need to set a mapping provider under Administer > System Settings > Mapping and Geocoding');
         $this->returnError = 1;
         $this->returnResult();
@@ -68,7 +68,7 @@ class CRM_Utils_Address_BatchUpdate {
     else {
       $processGeocode = TRUE;
       // user might want to over-ride.
-      if ($this->geocoding == 'false') {
+      if (CRM_Utils_String::strtobool($this->geocoding) === FALSE) {
         $processGeocode = FALSE;
       }
     }
@@ -83,7 +83,7 @@ class CRM_Utils_Address_BatchUpdate {
     );
     $parseStreetAddress = FALSE;
     if (!$parseAddress) {
-      if ($this->parse == 'true') {
+      if (CRM_Utils_String::strtobool($this->parse) === TRUE) {
         $this->returnMessages[] = ts('Error: You need to enable Street Address Parsing under Administer > Localization > Address Settings.');
         $this->returnError = 1;
         return $this->returnResult();
@@ -92,7 +92,7 @@ class CRM_Utils_Address_BatchUpdate {
     else {
       $parseStreetAddress = TRUE;
       // user might want to over-ride.
-      if ($this->parse == 'false') {
+      if (CRM_Utils_String::strtobool($this->parse) === FALSE) {
         $parseStreetAddress = FALSE;
       }
     }