From: JKingsnorth Date: Wed, 8 Apr 2015 13:57:10 +0000 (+0100) Subject: CRM-16256: Skip empty fields on dedupe X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=161bb30b51a636312963ea87037d9cada8c2787d;p=civicrm-core.git CRM-16256: Skip empty fields on dedupe --- diff --git a/CRM/Dedupe/BAO/Rule.php b/CRM/Dedupe/BAO/Rule.php index c268422f46..8ce162446b 100644 --- a/CRM/Dedupe/BAO/Rule.php +++ b/CRM/Dedupe/BAO/Rule.php @@ -150,6 +150,7 @@ class CRM_Dedupe_BAO_Rule extends CRM_Dedupe_DAO_Rule { if ($this->rule_length) { $where[] = "SUBSTR(t1.{$this->rule_field}, 1, {$this->rule_length}) = SUBSTR('$str', 1, {$this->rule_length})"; $where[] = "t1.{$this->rule_field} IS NOT NULL"; + $where[] = "t1.{$this->rule_field} <> ''"; } else { $where[] = "t1.{$this->rule_field} = '$str'"; @@ -168,6 +169,7 @@ class CRM_Dedupe_BAO_Rule extends CRM_Dedupe_DAO_Rule { if (!$this->params) { $where[] = "t1.$id < t2.$id"; $where[] = "t1.{$this->rule_field} IS NOT NULL"; + $where[] = "t1.{$this->rule_field} <> ''"; } if ($this->contactIds) { $cids = array();