CRM-20858: Call moveContactBelongings Only Once
authorCamilo Rodriguez <camilo@compucorp.co.uk>
Mon, 21 Aug 2017 16:12:00 +0000 (16:12 +0000)
committerCamilo Rodriguez <camilo@compucorp.co.uk>
Mon, 21 Aug 2017 17:15:30 +0000 (17:15 +0000)
commit0556db5dbd30f3d109a1685a6f78762bb9ecb9a4
tree2843384e078321d2b0dc4a91330c871912bedd95
parent4b047375cf185613b1ccd8a768eaf1fa646a82de
CRM-20858: Call moveContactBelongings Only Once

moveContactBelongings() was bing called twice, first to move selected related
tables, and the second to move all other tables that reference contacts table.

Refactored moveContactBelongings() method so that it can be called only once,
by calculating in one go the tables that have to be taken into account when
merging, according to what has been selected to move.  Basically, it searches
for all tables related to the contact, removes related tables, and then
includes only those related tables selected to be merged.
CRM/Dedupe/Merger.php