CRM_Core_BAO_Address::processSharedAddressRelationship only checks for "Household member of" and not "Head of household for" if sharing address with a household
It only checks for "Household member of" and not "Head of household for". So it creates a duplicate relationship.
Steps:
- Create a household and an individual.
- Add an address to the household.
- Add relationship "Head of household for" between the two.
- Go to
/civicm/api4
. - Create an address on the individual with a master_id = the household's address ID. (May need to first look up these IDs).
E.g.
$results = civicrm_api4('Address', 'create', [
'values' => [
'contact_id' => 89,
'location_type_id' => 1,
'is_primary' => TRUE,
'master_id' => 95,
],
]);
Then look at the individual and it will have two relationships: Head of household and the new one: Household member.