Skip to content

Commit

Permalink
CRM-20800 follow on fix per Matt review
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Nov 30, 2017
1 parent 50656a3 commit 3bc67dd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions CRM/Contribute/Form/UpdateSubscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,18 @@ public function preProcess() {
$this->contributionRecurID = CRM_Utils_Request::retrieve('crid', 'Integer', $this, FALSE);
if ($this->contributionRecurID) {
try {
$this->_paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getPaymentProcessorForRecurringContribution($this->contributionRecurID);
$this->_paymentProcessorObj = CRM_Financial_BAO_PaymentProcessor::getPaymentProcessorForRecurringContribution($this->contributionRecurID);
}
catch (CRM_Core_Exception $e) {
CRM_Core_Error::statusBounce(ts('There is no valid processor for this subscription so it cannot be edited.'));
}
$this->_paymentProcessorObj = $this->_paymentProcessor['object'];
$this->_subscriptionDetails = CRM_Contribute_BAO_ContributionRecur::getSubscriptionDetails($this->contributionRecurID);
}

$this->_coid = CRM_Utils_Request::retrieve('coid', 'Integer', $this, FALSE);
if ($this->_coid) {
$this->_paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($this->_coid, 'contribute', 'info');
// @todo test & replace with $this->_paymentProcessorObj = Civi\Payment\System::singleton()->getById($this->_paymentProcessor['id']);
$this->_paymentProcessorObj = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($this->_coid, 'contribute', 'obj');
$this->_subscriptionDetails = CRM_Contribute_BAO_ContributionRecur::getSubscriptionDetails($this->_coid, 'contribution');
$this->contributionRecurID = $this->_subscriptionDetails->recur_id;
Expand Down Expand Up @@ -137,9 +137,6 @@ public function preProcess() {
}

$this->assign('editableScheduleFields', array_diff($this->editableScheduleFields, $alreadyHardCodedFields));
$this->assign('paymentProcessor', $this->_paymentProcessor);
$this->assign('frequency_unit', $this->_subscriptionDetails->frequency_unit);
$this->assign('frequency_interval', $this->_subscriptionDetails->frequency_interval);

if ($this->_subscriptionDetails->contact_id) {
list($this->_donorDisplayName, $this->_donorEmail) = CRM_Contact_BAO_Contact::getContactDetails($this->_subscriptionDetails->contact_id);
Expand Down

0 comments on commit 3bc67dd

Please sign in to comment.