}
if ($this->_contactIdIndex < 0) {
- // set the contact type if its not set
- if (!isset($paramValues['contact_type'])) {
- $paramValues['contact_type'] = $this->_contactType;
- }
$error = $this->checkContactDuplicate($paramValues);
}
else {
// we need to get contribution contact using de dupe
- $error = _civicrm_api3_deprecated_check_contact_dedupe($params);
+ $error = $this->checkContactDuplicate($params);
if (isset($error['error_message']['params'][0])) {
$matchedIDs = explode(',', $error['error_message']['params'][0]);
*/
protected function checkContactDuplicate(&$formatValues) {
//retrieve contact id using contact dedupe rule
- $formatValues['contact_type'] = $this->_contactType;
+ $formatValues['contact_type'] = $formatValues['contact_type'] ?? $this->_contactType;
$formatValues['version'] = 3;
require_once 'CRM/Utils/DeprecatedUtils.php';
$error = _civicrm_api3_deprecated_check_contact_dedupe($formatValues);