Skip to content

Commit

Permalink
CRM-19697 Do not make use of the static _links object when customizin…
Browse files Browse the repository at this point in the history
…g per payment processor for recurring contributions
  • Loading branch information
adixon committed Nov 30, 2016
1 parent 2436f78 commit afcaa7e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions CRM/Contribute/Page/Tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,23 @@ public static function &recurLinks($recurID = FALSE, $context = 'contribution')
}

if ($recurID) {
$links = self::$_links;
$paymentProcessorObj = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($recurID, 'recur', 'obj');
if (is_object($paymentProcessorObj) && $paymentProcessorObj->supports('cancelRecurring')) {
unset(self::$_links[CRM_Core_Action::DISABLE]['extra'], self::$_links[CRM_Core_Action::DISABLE]['ref']);
self::$_links[CRM_Core_Action::DISABLE]['url'] = "civicrm/contribute/unsubscribe";
self::$_links[CRM_Core_Action::DISABLE]['qs'] = "reset=1&crid=%%crid%%&cid=%%cid%%&context={$context}";
unset($links[CRM_Core_Action::DISABLE]['extra'], $links[CRM_Core_Action::DISABLE]['ref']);
$links[CRM_Core_Action::DISABLE]['url'] = "civicrm/contribute/unsubscribe";
$links[CRM_Core_Action::DISABLE]['qs'] = "reset=1&crid=%%crid%%&cid=%%cid%%&context={$context}";
}

if (is_object($paymentProcessorObj) && $paymentProcessorObj->isSupported('updateSubscriptionBillingInfo')) {
self::$_links[CRM_Core_Action::RENEW] = array(
$links[CRM_Core_Action::RENEW] = array(
'name' => ts('Change Billing Details'),
'title' => ts('Change Billing Details'),
'url' => 'civicrm/contribute/updatebilling',
'qs' => "reset=1&crid=%%crid%%&cid=%%cid%%&context={$context}",
);
}
return $links;
}

return self::$_links;
Expand Down

0 comments on commit afcaa7e

Please sign in to comment.