dev/core#470: Current employer disapears when disabling expired relationships
authorMonish Deb <deb.monish@gmail.com>
Fri, 2 Aug 2019 02:43:53 +0000 (14:43 +1200)
committereileen <emcnaughton@wikimedia.org>
Sat, 3 Aug 2019 01:53:01 +0000 (13:53 +1200)
commit0c578c022f237e3904062d3f95d579bd809a286d
tree6f232b9d4e3e35986e662966ffe1ec8717823a69
parentfe5c9a722b841254996196bf9526e575aaab35b3
dev/core#470: Current employer disapears when disabling expired relationships

Overview
----------------------------------------
Steps to replicate:

1. Create a current relationship (set empty end-date) on individual A as  organization A and mark as current employer
2. Create a past relationship on individual A as  organization B without marking as current employer
3. Run Disable expired relationships cron job

Before
----------------------------------------
Result: Clear the employer field of Contact A

After
----------------------------------------
Result: Does not clear the employer field of Contact A

Technical Details
----------------------------------------
This PR replaces https://github.com/civicrm/civicrm-core/pull/13334
CRM/Contact/BAO/Relationship.php
tests/phpunit/api/v3/RelationshipTest.php