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;
}
}
}
$mainContacts[] = $row = [
- 'dstID' => $dstID,
+ 'dstID' => (int) $dstID,
'dstName' => $displayNames[$dstID],
- 'srcID' => $srcID,
+ 'srcID' => (int) $srcID,
'srcName' => $displayNames[$srcID],
'weight' => $dupes[2],
'canMerge' => TRUE,
];
- $data = CRM_Core_DAO::escapeString(serialize($row));
- CRM_Core_BAO_PrevNextCache::setItem('civicrm_contact', $dstID, $srcID, $cacheKeyString, $data);
+ CRM_Core_DAO::executeQuery("INSERT INTO civicrm_prevnext_cache (entity_table, entity_id1, entity_id2, cacheKey, data) VALUES
+ ('civicrm_contact', %1, %2, %3, %4)", [
+ 1 => [$dstID, 'Integer'],
+ 2 => [$srcID, 'Integer'],
+ 3 => [$cacheKeyString, 'String'],
+ 4 => [serialize($row), 'String'],
+ ]
+ );
}
return $mainContacts;
}