From 1c19e0a3203a470cf517ed65b89971d865568a0c Mon Sep 17 00:00:00 2001 From: Pratik Joshi Date: Thu, 30 Jan 2014 09:27:22 +0530 Subject: [PATCH] fix-for-regression : caused by PR#2314 --- CRM/Contribute/BAO/Contribution.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index b67f2adcf7..31a01bcd04 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -2452,6 +2452,8 @@ WHERE contribution_id = %1 "; */ static function recordFinancialAccounts(&$params, $financialTrxnVals = NULL) { $skipRecords = $update = FALSE; + // in few scenarios we require the trxn record details which has got created + $return = NULL; $additionalParticipantId = array(); $contributionStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); @@ -2670,8 +2672,9 @@ WHERE contribution_id = %1 "; } if (!$update) { - //records finanical trxn and entity financial trxn - $financialTxn = CRM_Core_BAO_FinancialTrxn::create($trxnParams); + // records finanical trxn and entity financial trxn + // also make it available as return value + $return = $financialTxn = CRM_Core_BAO_FinancialTrxn::create($trxnParams); $params['entity_id'] = $financialTxn->id; } } @@ -2703,9 +2706,7 @@ WHERE contribution_id = %1 "; } unset($params['line_item']); - if (!$update) { - return $financialTxn; - } + return $return; } /** -- 2.25.1