CRM-16735: PCP notification email should not be sent when contribution record is...
authoryashodha <yashodha.chaku@webaccessglobal.com>
Wed, 1 Jul 2015 10:54:43 +0000 (16:24 +0530)
committeryashodha <yashodha.chaku@webaccessglobal.com>
Wed, 1 Jul 2015 10:54:43 +0000 (16:24 +0530)
----------------------------------------
* CRM-16735: PCP notification email should not be sent when contribution record is updated UNLESS a new PCP soft credit is added
  https://issues.civicrm.org/jira/browse/CRM-16735

CRM/Contribute/BAO/Contribution.php

index a4ab84a2a4f1a1f9bfd89c8f5ad63834a32d8b3d..aaaebbb8d603afb0700c24e5ee713ac1c193ad9f 100644 (file)
@@ -391,7 +391,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
       $softParams['soft_credit_type_id'] = CRM_Core_OptionGroup::getValue('soft_credit_type', 'pcp', 'name');
       $contributionSoft = CRM_Contribute_BAO_ContributionSoft::add($softParams);
       //Send notification to owner for PCP
-      if ($contributionSoft->pcp_id) {
+      if ($contributionSoft->pcp_id && empty($params['soft_credit_ids'])) {
         CRM_Contribute_Form_Contribution_Confirm::pcpNotifyOwner($contribution, $contributionSoft);
       }
     }