From 161bb30b51a636312963ea87037d9cada8c2787d Mon Sep 17 00:00:00 2001 From: JKingsnorth Date: Wed, 8 Apr 2015 14:57:10 +0100 Subject: [PATCH] CRM-16256: Skip empty fields on dedupe --- CRM/Dedupe/BAO/Rule.php | 2 ++ 1 file changed, 2 insertions(+) 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(); -- 2.25.1