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

Format returned by API for multi-select custom field different for Contact vs. Relationship

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 4.4.13, 4.6.3
    • Fix Version/s: Unscheduled
    • Component/s: CiviCRM API
    • Labels:
      None
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      With reference to: http://civicrm.stackexchange.com/questions/329/why-is-format-returned-for-multi-select-custom-field-api-different-for-contact-v The user who replied suggested to log it here as it documents an inconsistency. Replicated on 4.6 demo.

      I have contacts with an Alphanumeric/CheckBox custom field on, and I have relationships with an Alphanumeric/CheckBox custom field on. (The former is legacy and is copied into the latter.) These seem to be returned differently when using the getsingle API call. Why is this?

      For example:

      $ drush -u <uid> cvapi Contact.getsingle id=<cid> contact_type=Individual contact_sub_type=Student return=custom_42
      Array
      (
      ...
      [custom_42] => Array
      (
      [0] => Fundraise_Donate_for_specific_school_needs
      [1] => Apply_to_become_a_Governor
      [2] => Be on a poster displayed in your old school/college
      )
      ...
      )

      but:

      $ drush -u <uid> cvapi Relationship.getsingle id=<rid> relationship_type_id=21 return=custom_112
      Array
      (
      ...
      [custom_112] => Array
      (
      [Fundraise_Donate_for_specific_school_needs] => 1
      [Apply_to_become_a_Governor] => 1
      [Be on a poster displayed in your old school/college] => 1
      )
      ...
      )

      CustomValue.get, however, returns the same format for the Contact and the Relationship field, and that format is more like the Contact one above.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              DaveFF David Knoll
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: