From 8e776a1aa11a51b84c2c4a9610390453d2749d01 Mon Sep 17 00:00:00 2001 From: Sudha Bisht Date: Wed, 25 Nov 2015 15:19:54 +0530 Subject: [PATCH] Minor fix --- CRM/Contribute/BAO/Contribution.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index adae0522da..5798aa52d2 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -3991,6 +3991,10 @@ WHERE con.id = {$contributionId} $contribution_status_id, $original_contribution_status_id ) { + if (!$pledgePaymentID && $action & CRM_Core_Action::ADD && !$contributionID) { + return; + } + if ($pledgePaymentID) { //store contribution id in payment record. CRM_Core_DAO::setFieldValue('CRM_Pledge_DAO_PledgePayment', $pledgePaymentID, 'contribution_id', $contributionID); @@ -4003,7 +4007,7 @@ WHERE con.id = {$contributionId} ); } - if (!$pledgePaymentID || $action & CRM_Core_Action::ADD && !$contributionID) { + if (!$pledgePaymentID) { return; } $pledgeID = CRM_Core_DAO::getFieldValue('CRM_Pledge_DAO_PledgePayment', -- 2.25.1