CRM-20217 - ensure phone matching works on all formats of phone
authorJamie McClelland <jm@mayfirst.org>
Tue, 7 Mar 2017 20:55:29 +0000 (15:55 -0500)
committerJamie McClelland <jm@mayfirst.org>
Tue, 7 Mar 2017 20:55:29 +0000 (15:55 -0500)
Previously a phone match only worked if phone being imported was all
digits.

CRM/Dedupe/Finder.php

index e0d993dc768ab8bbfe372bda9222312bef77323f..980a2fd7bb648b9433607c08cd2b2a84d9469733 100644 (file)
@@ -145,6 +145,10 @@ class CRM_Dedupe_Finder {
     }
     $params['check_permission'] = CRM_Utils_Array::value('check_permission', $params, TRUE);
 
+    if (isset($params['civicrm_phone']['phone_numeric'])) {
+      $orig = $params['civicrm_phone']['phone_numeric'];
+      $params['civicrm_phone']['phone_numeric'] = preg_replace('/[^\d]/', '', $orig);
+    }
     $rgBao->params = $params;
     $rgBao->fillTable();
     $dao = new CRM_Core_DAO();