/** @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) {
// 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();
else {
$processGeocode = TRUE;
// user might want to over-ride.
- if ($this->geocoding == 'false') {
+ if (CRM_Utils_String::strtobool($this->geocoding) === FALSE) {
$processGeocode = FALSE;
}
}
);
$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();
else {
$parseStreetAddress = TRUE;
// user might want to over-ride.
- if ($this->parse == 'false') {
+ if (CRM_Utils_String::strtobool($this->parse) === FALSE) {
$parseStreetAddress = FALSE;
}
}