From: JKingsnorth Date: Thu, 28 Apr 2016 15:07:18 +0000 (+0100) Subject: CRM-18480: Don't allow 'deleted' contacts to be merged X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9b96584d417a8d438a05e9abec8f0ee30fea91ef;p=civicrm-core.git CRM-18480: Don't allow 'deleted' contacts to be merged --- diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index a983913124..eec229b6af 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -993,6 +993,12 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m if (empty($result['values'][$cid]['contact_type'])) { return FALSE; } + + // CRM-18480: Cancel the process if the contact is already deleted + if (isset($result['values'][$cid]['contact_is_deleted']) && !empty($result['values'][$cid]['contact_is_deleted'])) { + CRM_Core_Error::fatal(ts('Cannot merge because the \'%1\' contact (ID %2) has been deleted.', array(1 => $moniker, 2 => $cid))); + } + $$moniker = $result['values'][$cid]; } @@ -1834,7 +1840,6 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m $contactFields = CRM_Contact_DAO_Contact::fields(); $invalidFields = array( 'api_key', - 'contact_is_deleted', 'created_date', 'display_name', 'hash',