Merge pull request #17020 from eileenmcnaughton/dedupe1
[civicrm-core.git] / CRM / Dedupe / Finder.php
index dac4bf1359fbf63b00fec751f54248eebb3bd0ed..97e8abcf51bc6aabd98ad945e0cb2b57a8a55ab3 100644 (file)
@@ -230,7 +230,7 @@ class CRM_Dedupe_Finder {
         continue;
       }
       foreach ($cg['fields'] as $cf) {
-        $flat[$cf['column_name']] = CRM_Utils_Array::value('data', $cf['customValue']);
+        $flat[$cf['column_name']] = $cf['customValue']['data'] ?? NULL;
       }
     }
 
@@ -348,12 +348,12 @@ class CRM_Dedupe_Finder {
         'canMerge' => TRUE,
       ];
 
-      $data = CRM_Core_DAO::escapeString(serialize($row));
       CRM_Core_DAO::executeQuery("INSERT INTO civicrm_prevnext_cache (entity_table, entity_id1, entity_id2, cacheKey, data) VALUES
-        ('civicrm_contact', %1, %2, %3, '{$data}')", [
+        ('civicrm_contact', %1, %2, %3, %4)", [
           1 => [$dstID, 'Integer'],
           2 => [$srcID, 'Integer'],
           3 => [$cacheKeyString, 'String'],
+          4 => [serialize($row), 'String'],
         ]
       );
     }