From: yashodha Date: Mon, 28 Mar 2016 08:38:09 +0000 (+0530) Subject: CRM-18287: Cannot cancel pledge X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=10874ecc5e51fff4d7b2df9ec4bba68911e4a4b3;p=civicrm-core.git CRM-18287: Cannot cancel pledge ---------------------------------------- * CRM-18287: Cannot cancel pledge https://issues.civicrm.org/jira/browse/CRM-18287 --- 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 ); }