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

Memberships created on contact_id_b of a symmetrical relationship do not display related inherited memberships

    Details

    • Type: Bug
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 4.4.4
    • Fix Version/s: Unscheduled
    • Component/s: CiviMember
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)

      Description

      There are relationships that are symmetrical. In these it doesn't matter which contact is contact_id_a or contact_id_b. The name is the same in both directions. One example is given in the sample data "Spouse of".

      Nevertheless, in the database one contact is recorded as the b contact in the contact_id_b field. The a contact is the active contact at the time the relationship is created.

      When a membership is created that uses one of these relationships as the type to use for inheritance the direction is recorded in the civicrm_membership_type table as a_b. After this some features do not work correctly when the membership is created on the b contact.

      To reproduce on demo:
      1. Create a membership "Test family" that uses the sample "Spouse of" relationship as the relationship type for inheritance. Note that the relationship type only appears once in the field. After the membership type is created the relationship_direction field contains "a_b".
      2. Create two contacts "TestA" and "TestB".
      3. On the contact summary page for "TestA" choose the relationship tab and add a relationship of type "Spouse of". Lookup the contact "TestB" in the "Select Contact" field. When the relationship is created contact_id_b will be TestB because TestA's page was active.
      4. On the contact summary page for "TestB" choose the membership tab and add a membership of type "Test family". Save it.
      5. The issue: When viewing the new membership notice that there is a section for "Related Contacts/Memberships" and this shows "There are no records". However, viewing the contact summary for "TestA" shows that the inherited relationship was created. It displays there with the option to view the primary.

      I think there may be two parts to this.
      1. In the civicrm_membership_type table the relationship_direction should be recorded as "both" not "a_b" to allow for accurate reporting with external reporting tools.
      2. The issues with retrieving the related memberships when the primary member is the b contact.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              lola_slade Lola Slade
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: