Contribution.php (civicrm-core-5.59.2) | : | Contribution.php (civicrm-core-5.59.3) | ||
---|---|---|---|---|
skipping to change at line 443 | skipping to change at line 443 | |||
} | } | |||
$contributionParams['id'] = $existingContribution['id'] ?? NULL; | $contributionParams['id'] = $existingContribution['id'] ?? NULL; | |||
if (empty($contributionParams['id']) && $this->isUpdateExisting()) { | if (empty($contributionParams['id']) && $this->isUpdateExisting()) { | |||
throw new CRM_Core_Exception('Empty Contribution and Invoice and Transac tion ID. Row was skipped.', CRM_Import_Parser::ERROR); | throw new CRM_Core_Exception('Empty Contribution and Invoice and Transac tion ID. Row was skipped.', CRM_Import_Parser::ERROR); | |||
} | } | |||
$contributionParams['contact_id'] = $params['Contact']['id'] = $this->getC ontactID($params['Contact'] ?? [], $contributionParams['contact_id'] ?? ($existi ngContribution['contact_id'] ?? NULL), 'Contact', $this->getDedupeRulesForEntity ('Contact')); | $contributionParams['contact_id'] = $params['Contact']['id'] = $this->getC ontactID($params['Contact'] ?? [], $contributionParams['contact_id'] ?? ($existi ngContribution['contact_id'] ?? NULL), 'Contact', $this->getDedupeRulesForEntity ('Contact')); | |||
$softCreditParams = []; | $softCreditParams = []; | |||
foreach ($params['SoftCreditContact'] ?? [] as $index => $softCreditContac t) { | foreach ($params['SoftCreditContact'] ?? [] as $index => $softCreditContac t) { | |||
$softCreditParams[$index]['soft_credit_type_id'] = $softCreditContact['s oft_credit_type_id']; | $softCreditParams[$index]['soft_credit_type_id'] = $softCreditContact['s oft_credit_type_id']; | |||
$softCreditParams[$index]['contact_id'] = $this->getContactID($softCredi tContact['Contact'], $softCreditContact['Contact']['id'] ?? NULL, 'SoftCreditCon tact', $this->getDedupeRulesForEntity('SoftCreditContact')); | $softCreditParams[$index]['contact_id'] = $this->getContactID($softCredi tContact['Contact'], !empty($softCreditContact['Contact']['id']) ? $softCreditCo ntact['Contact']['id'] : NULL, 'SoftCreditContact', $this->getDedupeRulesForEnti ty('SoftCreditContact')); | |||
if (empty($softCreditParams[$index]['contact_id']) && in_array($this->ge tActionForEntity('SoftCreditContact'), ['update', 'select'])) { | if (empty($softCreditParams[$index]['contact_id']) && in_array($this->ge tActionForEntity('SoftCreditContact'), ['update', 'select'])) { | |||
throw new CRM_Core_Exception(ts('Soft Credit Contact not found')); | throw new CRM_Core_Exception(ts('Soft Credit Contact not found')); | |||
} | } | |||
} | } | |||
$this->deprecatedFormatParams($contributionParams, $contributionParams); | $this->deprecatedFormatParams($contributionParams, $contributionParams); | |||
// From this point on we are changing stuff - the prior rows were doing lo okups and exiting | // From this point on we are changing stuff - the prior rows were doing lo okups and exiting | |||
// if the lookups failed. | // if the lookups failed. | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |