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

API: when getting contact chaining relationships, the relationship direction is ignored

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.5.8, 4.6
    • Fix Version/s: 4.6
    • Component/s: CiviCRM API
    • Documentation Required?:
      None

      Description

      Let's say that contact 187 is the child of contact 166. If you try to get contact 187 with it's children like this:

      $result = civicrm_api3('Contact', 'get', array(
      'sequential' => 1,
      'id' => 187,
      'api.Relationship.get' => array('contact_id_b' => "\$value.id", 'relationship_type_id' => 1),
      'options' => array('return' => "last_name"),
      ));

      Then it returns the relationship with contact 166 as well, although 166 is the parent of 187, and not the child.

      This issue is related to CRM-15983.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              johanv Johan Vervloet
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: