Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.6.9
-
Fix Version/s: 4.7
-
Component/s: CiviCRM API
-
Labels:
-
Documentation Required?:None
-
Funding Source:Core Team Funds
Description
I have a bit of custom code on one site that pulls contacts based on 'Primary Address country' as follows (example):
$contactcount=civicrm_api("Contact","getcount", array ('version' =>'3', 'contact_type' =>'Organization', 'country' =>'United States');
When I try this on the API Explorer on the demo site, I get this error:
"error_message":"A fatal error was triggered: United States is not of the type Positive"
It seems to have stopped working with an upgrade from 4.6.7 to 4.6.9. Did something change in the API call?
Update:
I was trying to rough in some temporary code to make this functional by using the Country ID instead of the Country Name, and there seems to be a problem there, too. The country ID field in the API seems to be essentially ignored.
$contactcount=civicrm_api("Contact","getcount", array ('version' =>'3', 'contact_type' =>'Organization', 'country_id' => 1228);
I verified this on the demo site, too.
Attachments
Issue Links
- links to