Skip to content

Commit

Permalink
replace legacy is_a(..CRM_Core_Error) code removed in last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich Lott / Artful Robot committed Nov 5, 2019
1 parent 7ee8eb3 commit 2b38ecf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CRM/Contribute/Form/CancelSubscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ public function postProcess() {
}
}

if ($cancelSubscription) {
if (is_a($cancelSubscription, 'CRM_Core_Error')) {
CRM_Core_Error::displaySessionError($cancelSubscription);
}
elseif ($cancelSubscription) {
try {
civicrm_api3('ContributionRecur', 'cancel', [
'id' => $this->_subscriptionDetails->recur_id,
Expand Down
9 changes: 7 additions & 2 deletions CRM/Contribute/Form/UpdateSubscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,13 @@ public function postProcess() {
CRM_Core_Error::statusBounce($e->getMessage());
}
}

if ($updateSubscription) {
if (is_a($updateSubscription, 'CRM_Core_Error')) {
CRM_Core_Error::displaySessionError($updateSubscription);
$status = ts('Could not update the Recurring contribution details');
$msgTitle = ts('Update Error');
$msgType = 'error';
}
elseif ($updateSubscription) {
// Handle custom data
$params['custom'] = CRM_Core_BAO_CustomField::postProcess($params, $this->contributionRecurID, 'ContributionRecur');
// save the changes
Expand Down

0 comments on commit 2b38ecf

Please sign in to comment.