From: Ian Wilson Date: Mon, 14 Feb 2022 17:06:09 +0000 (-0500) Subject: dev/core#3066 - Add check for CiviPledge component X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f70d393bec9d9c60138e307aafaeaf74fe9a7264;p=civicrm-core.git dev/core#3066 - Add check for CiviPledge component Check that component is enabled before attempting to disconnect pledge payments from Failed / Cancelled contributions. --- diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 45f2f87863..8851522c74 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -505,6 +505,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { CRM_Contribute_BAO_ContributionSoft::processSoftContribution($params, $contribution); if (!empty($params['id']) && !empty($params['contribution_status_id']) + && CRM_Core_Component::isEnabled('CiviPledge') ) { self::disconnectPledgePaymentsIfCancelled((int) $params['id'], CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $params['contribution_status_id'])); }