CiviCRM Membership, inherited membership remains active even when the primary member has been marked as deleted
CiviCRM Membership, inherited membership remains active even when the primary member has been marked as deleted. Reproduced on CiviCRM 5.37.alpha1. Observed since CiviCRM 5.33.2 and earlier.
Steps to reproduce:
- Set up a Membership Type which can be inherited using the Employer Of relationship, Membership A
- Create Organisation contact, Org B
- Assign Membership A to Org B
- Create Organisation contact, Org C
- Assign Membership A to Org C
- Create Employer Of relationship for Individual D, E, F with Org B
- Note that Individual D, E, F have inherited Membership A from Org B
- Merge Org B (Duplicate) and Org C (Original)
- During the Merge action, keep the merge Relationship option enabled. This problem can be replicated with either enable or disable of the Move Related Memberships.
- The merge action will mark Org B (Duplicate) as deleted
- Post merge, check Individual D, E, F
- Note that the Employer Of relationship for Individual D, E, F has been changed to Org C, this is correct.
- Note that Individual D, E, F still have inherited Membership A from Org B (the deleted contact) - this is incorrect, see below.
The desired result is that Individual D, E, F will have inherited Membership A from Org C. The Relationship has been transferred to Org C which should trigger then membership to be inherited from Org C, not Org B.
Workaround is to restore the deleted Org C from trash and delete the Membership record. Then for each of the Individual contacts, disable and re-enable the Relationship with Org B. This should restore the correct inherited relationship.
Agileware Ref: CIVICRM-906 CIVICRM-1922
Screenshots below of reproduced issue.
- Green Action School DUPLICATE (Org B)
- Green Action School ORIGINAL (Org C)
- The two Individual Contacts show the incorrect inherited membership, associated with the Green Action School DUPLICATE (Org B).