Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-20177

Too many results from civicrm_api3_contact_get()

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 4.7.16
    • Fix Version/s: None
    • Component/s: CiviCRM API
    • Labels:
    • 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",
      ));

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              martin_rotter Martin Rotter
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: