Fix for #1767: https://lab.civicrm.org/dev/core/-/issues/1767
authorJaap Jansma <jaap.jansma@civicoop.org>
Tue, 19 May 2020 15:43:34 +0000 (17:43 +0200)
committerJaap Jansma <jaap.jansma@civicoop.org>
Tue, 19 May 2020 15:43:34 +0000 (17:43 +0200)
CRM/Dedupe/Finder.php

index 97e8abcf51bc6aabd98ad945e0cb2b57a8a55ab3..6c936c246b56985399b2233b79b2d2e4b460fcc5 100644 (file)
@@ -252,7 +252,7 @@ class CRM_Dedupe_Finder {
     // the -digit to civicrm_address.location_type_id and -Primary to civicrm_address.is_primary
     foreach ($flat as $key => $value) {
       $matches = [];
-      if (preg_match('/(.*)-(Primary-[\d+])$|(.*)-(\d+|Primary)$/', $key, $matches)) {
+      if (preg_match('/(.\*)-(Primary-[\d+])$|(.\*)-(\d+-\d+)$|(.\*)-(\d+|Primary)$/', $key, $matches)) {
         $return = array_values(array_filter($matches));
         // make sure the first occurrence is kept, not the last
         $flat[$return[1]] = empty($flat[$return[1]]) ? $value : $flat[$return[1]];