1

I have this problem on the Joomla demo site (4.6.0) and my own sites with versions 4.6.8 and 4.7.1.

If I use the API explorer or run test php code, with a query checking for multiple contact_sub_type, I get 0 results:

$result = civicrm_api3('Contact', 'get', array(
  'sequential' => 1,
  'return' => "contact_sub_type",
  'contact_sub_type' => array('IN' => array("Student", "Parent")),
));

But if I search using the = operator for one contact_sub_type at a time, it returns the expected results:

$result = civicrm_api3('Contact', 'get', array(
  'sequential' => 1,
  'return' => "contact_sub_type",
  'contact_sub_type' => "Parent",
));

{"is_error":0,"version":3,"count":1,"id":7,"values":[{"contact_id":"7","contact_sub_type":["Parent"],"contact_is_deleted":"0","id":"7"}]}

This happens with subtypes of both Organization and Individual types.

I could work around it by performing multiple api calls and merging the results, but this seems like a bug?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.