Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Duplicate
-
Affects Version/s: 4.7.16
-
Fix Version/s: None
-
Component/s: CiviCRM API
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Core Team Funds
-
Verified?:No
Description
A call to "civicrm_api3_contact_get" searching for members of a group and some second criteria (like "name=Foo" or "on_hold=0") returns ALL group members independent of the second criteria.
Steps to reproduce:
1) Add a contact with last_name "Foo" to a group with at least 2 members.
2) Goto API Explorer
3) select "Contact" "get"
4) Add parameter "group" to restrict results to the mebers of this group
5) Add parameter "last_name"=Foo to restrict results to this contact only
6) Result contains all group members (instead of only contact "Foo").
$result = civicrm_api3('Contact', 'get', array(
'sequential' => 1,
'group' => array('LIKE' => 2), //assuming the group id=2
'last_name' => "Foo",
));