From 10874ecc5e51fff4d7b2df9ec4bba68911e4a4b3 Mon Sep 17 00:00:00 2001 From: yashodha Date: Mon, 28 Mar 2016 14:08:09 +0530 Subject: [PATCH] CRM-18287: Cannot cancel pledge ---------------------------------------- * CRM-18287: Cannot cancel pledge https://issues.civicrm.org/jira/browse/CRM-18287 --- CRM/Pledge/BAO/Pledge.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CRM/Pledge/BAO/Pledge.php b/CRM/Pledge/BAO/Pledge.php index bd77b43a18..8687d908b9 100644 --- a/CRM/Pledge/BAO/Pledge.php +++ b/CRM/Pledge/BAO/Pledge.php @@ -1108,10 +1108,11 @@ SELECT pledge.contact_id as contact_id, * @param int $pledgeID */ public static function cancel($pledgeID) { - $statuses = array_flip(CRM_Contribute_PseudoConstant::contributionStatus()); $paymentIDs = self::findCancelablePayments($pledgeID); + $status = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); + $cancelled = array_search('Cancelled', $status); CRM_Pledge_BAO_PledgePayment::updatePledgePaymentStatus($pledgeID, $paymentIDs, NULL, - $statuses['Cancelled'], 0, FALSE, TRUE + $cancelled, 0, FALSE, TRUE ); } -- 2.25.1