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

Membership API: crm_create_contact_membership fails to get related contactIDs

    Details

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

      Description

      The crm_create_contact_membership function in the Membership API gets related contacts by calling checkMembershipRelationship in CRM/Member/BAO/Membership. checkMembershipRelationship returns an associative array of ContactID => status. This causes Membership API to use the STATUS as the CONTACTID (OOPS).

      Easy to fix though.

      change:

      foreach ( $relatedContacts as $contactId ) {

      in the crm_create_contact_membership function (line 380 or so), to:

      foreach ( $relatedContacts as $contactId => $status ) {

      should now work as expected.

        Attachments

          Activity

            People

            • Assignee:
              junia Junia Biswas
              Reporter:
              criticny mischa beitz
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 30 minutes
                30m
                Remaining:
                Remaining Estimate - 30 minutes
                30m
                Logged:
                Time Spent - Not Specified
                Not Specified