CRM-16735: PCP notification email should not be sent when contribution record is...
authoryashodha <yashodha.chaku@webaccessglobal.com>
Tue, 7 Jul 2015 10:29:40 +0000 (15:59 +0530)
committeryashodha <yashodha.chaku@webaccessglobal.com>
Tue, 7 Jul 2015 10:29:40 +0000 (15:59 +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..400675b8e2ace4f0d4d7398c93b1527c41a5d742 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($pcpId)) {
         CRM_Contribute_Form_Contribution_Confirm::pcpNotifyOwner($contribution, $contributionSoft);
       }
     }