reference to used address is lost - address master_id is set to NULL when referenced address or owning contact are edited
Overview
If a contact uses the address of another contact this connection is lost, when the source contacts information is edited.
This is true for editing the address on the contact overview page via "Edit address" or via the "Edit" button on top. In both cases "Save" will trigger the disconnection. There is no need to enter new data to trigger the behavior, just save.
After that the changed address data can be found on both contacts, but the reference to the source contact is no longer there.
It seems that problem was introduced with CiviCRM 5.75.x. Test with older versions does not show that behavior.
Reproduction steps
-
Find or make a contact which uses the address of another contact.
-
Go to the contact which address is used.
-
Edit and save the address.
-
Go back to the contact that uses the address and reload the page.
-
The reference to the source contact is no longer displayed, but the changes made to source address are there.
Current behaviour
Reference to source address is lost if the source address or the source contact data is edited and saved.
Expected behaviour
The reference should stay in place, when the source address or source contact data is edited.
This was standard be
Environment information
- CiviCRM: introduced with 5.75.0
- Reproduced on https://d10-master.demo.civicrm.org/ today.
Comments
I looked via api at the address data of the connected address and the master_id which showed the id of the connected address is set to NULL after the source address is saved.
The problem might be introduced here where some work on the address connection was done.