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

API errors trying getcount members of a group

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Incomplete
    • Affects Version/s: 4.6.11, 4.7
    • Fix Version/s: None
    • Component/s: CiviCRM API
    • Labels:
      None
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      The API gives a fatal error of just disregards selecting a group. Because of that it is not possible to do a getcount of the members of a group. Tried this locally and on the 4.7 sandbox.

      Using:
      'group' => "Newsletter Subscribers"
      It gives a fatal error:
      "error_message":"A fatal error was triggered: Newsletter Subscribers is not of the type Int"

      Using:
      'group_id' => "Newsletter Subscribers"
      It doesnt give the fatal error but disregards the filter anyway.

      $result = civicrm_api3('Contact', 'get', array(
      'group_id' => "Newsletter Subscribers",
      'options' => array('limit' => 9999),
      ));

      Result:
      "is_error":0,
      "version":3,
      "count":211 (which is the total number of contacts in the database)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              magnolia61 Richard
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: