Skip to content
Snippets Groups Projects
Commit 8200d011 authored by bgm's avatar bgm Committed by Eileen McNaughton
Browse files

#4166 Fix Contribute Import Parser fatal when soft-credit is empty

parent 296d9bc9
Branches
Tags
No related merge requests found
......@@ -440,7 +440,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.
Please register or to comment