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

crm_fetch_contact is returning the wrong value type (object instead of assoc. array)

    Details

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

      Description

      The new crm_fetch_contact is documented to do the following:

      [quote]
      crm_fetch_contact( $params, $return_properties = null )

      Availability: v1.4

      Returns an array with the return property values for the contact. Note that the return value is not a contact object. $params can be any valid search parameter. See the search api's for more detailed documentation.

      An error object is returned if there is no match, or more than one match.

      Parameters:

      • 'params' (array) Associative array of property name/value pairs to attempt to match on. Refer to the Data Model for available properties for each contact type.

      Returns:

      • Array of values for the return properties list

      [/quote]

      This really is what it should do.

      Instead, it's now returning a contact object (of type CRM_Contact_BAO_Contact).

      Easiest way to verify this is in a debugger, which I've done.

        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: