From: Pratik Joshi Date: Thu, 30 Jan 2014 03:57:22 +0000 (+0530) Subject: fix-for-regression : caused by PR#2314 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1c19e0a3203a470cf517ed65b89971d865568a0c;p=civicrm-core.git fix-for-regression : caused by PR#2314 --- 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; } /**