X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FAddress%2FBatchUpdate.php;h=49a8903c18ea1f452ef0c27982f3a8fb47a0600b;hb=95e3f3974e8e214529fbaed0fbd598e20d8ff64c;hp=7a00acbf9df547e6318fb47070892777dc6d78ab;hpb=19d9e52e2519a5c77c4000b60e37b26c14dc9613;p=civicrm-core.git diff --git a/CRM/Utils/Address/BatchUpdate.php b/CRM/Utils/Address/BatchUpdate.php index 7a00acbf9d..49a8903c18 100644 --- a/CRM/Utils/Address/BatchUpdate.php +++ b/CRM/Utils/Address/BatchUpdate.php @@ -1,9 +1,9 @@ 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; } } @@ -213,9 +213,7 @@ class CRM_Utils_Address_BatchUpdate { $success = TRUE; // consider address is automatically parseable, // when we should found street_number and street_name - if (!CRM_Utils_Array::value('street_name', $parsedFields) || - !CRM_Utils_Array::value('street_number', $parsedFields) - ) { + if (empty($parsedFields['street_name']) || empty($parsedFields['street_number'])) { $success = FALSE; }