From 16381e37471ab695115573caefc75f7cc96ade44 Mon Sep 17 00:00:00 2001 From: Jon goldberg Date: Mon, 25 Apr 2016 18:36:54 -0400 Subject: [PATCH] CRM-18468 - Recurring Contributions - don't use mid for subscription details if you can use crid --- CRM/Contribute/Form/CancelSubscription.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CRM/Contribute/Form/CancelSubscription.php b/CRM/Contribute/Form/CancelSubscription.php index db83d20ffc..817fc58af8 100644 --- a/CRM/Contribute/Form/CancelSubscription.php +++ b/CRM/Contribute/Form/CancelSubscription.php @@ -71,12 +71,13 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Core_Form { } if ($this->_mid) { - if (CRM_Member_BAO_Membership::isSubscriptionCancelled($this->_mid)) { - CRM_Core_Error::fatal(ts('The auto renewal option for this membership looks to have been cancelled already.')); - } $this->_mode = 'auto_renew'; - $this->_paymentProcessorObj = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($this->_mid, 'membership', 'obj'); - $this->_subscriptionDetails = CRM_Contribute_BAO_ContributionRecur::getSubscriptionDetails($this->_mid, 'membership'); + // CRM-18468: crid is more accurate than mid for getting + // subscriptionDetails, so don't get them again. + if (!$this->_crid) { + $this->_paymentProcessorObj = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($this->_mid, 'membership', 'obj'); + $this->_subscriptionDetails = CRM_Contribute_BAO_ContributionRecur::getSubscriptionDetails($this->_mid, 'membership'); + } $membershipTypes = CRM_Member_PseudoConstant::membershipType(); $membershipTypeId = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $this->_mid, 'membership_type_id'); -- 2.25.1