Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Blocker
-
Resolution: Fixed/Completed
-
Affects Version/s: 2.0
-
Fix Version/s: 2.1
-
Component/s: CiviMember
-
Labels:None
Description
When creating a membership for a contact that is, say, a member of a household, the API doesn't properly create the memberships for the related contacts. The problems is that in the API call, the API uses CRM_Member_BAO_Membership::checkMembershipRelationship that returns an array of the related contacts. The returned array is a set of "contact_id" => "relationship_type_id" pairs, and the API code expects just "index" => "contact_id" pairs.
The code in the API currently looks like this:
<code>
foreach ( $relatedContacts as $contactId )
</code>
And it should look like this:
<code>
foreach ( $relatedContacts as $contactId => $relationTypeId )
</code>