Skip to content
Snippets Groups Projects
Unverified Commit a946ed24 authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #25806 from mlutfy/core4166rc

#4166 Fix Contribute Import Parser fatal when soft-credit is empty
parents d8a2574a 2bf18944
No related branches found
No related tags found
No related merge requests found
......@@ -434,7 +434,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser {
$softCreditParams = [];
foreach ($params['SoftCreditContact'] ?? [] as $index => $softCreditContact) {
$softCreditParams[$index]['soft_credit_type_id'] = $softCreditContact['soft_credit_type_id'];
$softCreditParams[$index]['contact_id'] = $this->getContactID($softCreditContact['Contact'], $softCreditContact['Contact']['id'] ?? NULL, 'SoftCreditContact', $this->getDedupeRulesForEntity('SoftCreditContact'));
$softCreditParams[$index]['contact_id'] = $this->getContactID($softCreditContact['Contact'], !empty($softCreditContact['Contact']['id']) ? $softCreditContact['Contact']['id'] : NULL, 'SoftCreditContact', $this->getDedupeRulesForEntity('SoftCreditContact'));
if (empty($softCreditParams[$index]['contact_id']) && in_array($this->getActionForEntity('SoftCreditContact'), ['update', 'select'])) {
throw new CRM_Core_Exception(ts('Soft Credit Contact not found'));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment