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

Change in crm_get_group_contacts behavior on error

    Details

    • Type: Patch
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.4
    • Component/s: None
    • Labels:
      None

      Description

      I'm including a patch to make crm_get_group_contacts behave like crm_fetch_contact does on error: rather than call fatal() and make a non-local exit, I've changed it to return an error object.

      Patch has two components:
      1) CRM/Core/Error.php now has a static create_error() method that takes the same arguments as the HL API call _crm_error(). It does exactly the same thing: create an error and put it on the error stack.

      2) CRM/Contacts/BAO/GroupContacts.php now calls create_error instead of fatal in the two places where fatal was called before.

      This creates the possibility of the calling application to deal with a missing gid or lack of permissions more elegantly than is currently possible.

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              torenware Rob Thorne
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: