Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-11618

Variables not properly assigned when canceling a subscription

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Critical
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.2.6
    • Fix Version/s: 4.3.0
    • Component/s: CiviContribute
    • Labels:
      None

      Description

      Whenever a Contribution in canceled a user is sent to a form located at:
      CRM/Contribute/Form/CancelSubscription.php

      Lines 68-71 properly assign the variables if the condition is met.

      However, if a later condition is met, like the one on Line 92, these variables are not assigned.

      To remidy this problem we simply copied lines 68-71 and placed them between Lines 98 & 99.

      So the new conditional at Line 92 looks like this:

      if ($this->_coid) {
      if (CRM_Contribute_BAO_Contribution::isSubscriptionCancelled($this->_coid))

      { CRM_Core_Error::fatal(ts('The recurring contribution looks to have been cancelled already.')); }

      $this->_paymentProcessorObj = CRM_Core_BAO_PaymentProcessor::getProcessorForEntity($this->_coid, 'contribute', 'obj');
      $this->_subscriptionDetails = CRM_Contribute_BAO_ContributionRecur::getSubscriptionDetails($this->_coid, 'contribution');

      $this->assign('frequency_unit', $this->_subscriptionDetails->frequency_unit);
      $this->assign('frequency_interval', $this->_subscriptionDetails->frequency_interval);
      $this->assign('amount', $this->_subscriptionDetails->amount);
      $this->assign('installments', $this->_subscriptionDetails->installments);
      }

      This issue was first discovered by Donor Depot
      http://www.donordepot.com

      thanks!
      david barratt

        Attachments

          Activity

            People

            • Assignee:
              yashodha Yashodha Chaku
              Reporter:
              davidcamna David Barratt
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: