Related / Inherited Memberships: New Relationship added to membership does not copy custom fields
Overview
CiviCRM offers the option to share a membership between a group of contacts. For example the employees of a company or the members of a household. In the databases this is ensured by creating a copy of each membership record. On of them is the parent record, the interface allows to change it. Alle the properties are subsequently copied to the other membership records.
A membership can have customfields, and these are copied as well (in the near future after the merge of https://github.com/civicrm/civicrm-core/pull/15884).
When a new contact is added to the group, by creating the new relationship, a new copy of the membership is created. However the creation of the corresponding custom fields is ommited.
Reproduction steps
The bug can reproduced on a copy of the dmaster database 5.21.alpha1
- Install https://github.com/civicrm/civicrm-core/pull/15884)
- Create a new Household Membership Membership. Add the following to relationships to the membership. Head of Household is and Household Member is
- Create a custom field that is valid for this membership:
- Make the Grant family a member. Fill the custom field with a value. The membership is copied nicely to all the Grant Children and parents. In the records there is copy of the custom value.
- Now add a new Relationship with the type Household Member (Of if see the need a second Head of the Household). Create a in the process, and name it Luke Grant
Current behaviour
Go the contact card of Luke Grant and inspect is membership. The custom field is empty:
Expected behaviour
The custom field should have the same value as the parent membership.
Comments
The issue is related to #1365 (closed)