dev/core#1998 Address dedupe clash on dashboard contact
authoreileen <emcnaughton@wikimedia.org>
Fri, 4 Sep 2020 07:10:06 +0000 (19:10 +1200)
committerColeman Watts <coleman@civicrm.org>
Fri, 4 Sep 2020 23:32:07 +0000 (19:32 -0400)
CRM/Dedupe/Merger.php

index d8fd267310cdb0fcd3a44cce95ca89727651342d..69827f16192f092175828e3fb217564ec6499268 100644 (file)
@@ -541,6 +541,12 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
         continue;
       }
 
+      if ($table === 'civicrm_dashboard_contact') {
+        $sqls[] = "UPDATE IGNORE civicrm_dashboard_contact SET contact_id = $mainId WHERE contact_id = $otherId";
+        $sqls[] = "DELETE FROM civicrm_dashboard_contact WHERE contact_id = $otherId";
+        continue;
+      }
+
       if ($table === 'civicrm_dedupe_exception') {
         $sqls[] = "UPDATE IGNORE civicrm_dedupe_exception SET contact_id1 = $mainId WHERE contact_id1 = $otherId";
         $sqls[] = "UPDATE IGNORE civicrm_dedupe_exception SET contact_id2 = $mainId WHERE contact_id2 = $otherId";