From e34dd94b58a1fc1d8427083d18914afcbc9c39d4 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 9 Apr 2013 19:28:51 +1200 Subject: [PATCH] CRM-12306 - only save ->values['is_email_receipt'] to ['is_email_receipt'] if not already set --- CRM/Contribute/Form/Contribution/Confirm.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 6d2f76c4b1..ca96a812fd 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -919,7 +919,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr } } } - + CRM_Member_BAO_Membership::postProcessMembership($membershipParams, $contactID, $this, $premiumParams, $customFieldsFormatted, $fieldTypes @@ -1100,8 +1100,15 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr // add these values for the recurringContrib function ,CRM-10188 $params['financial_type_id'] = $contributionType->id; - $params['is_email_receipt'] = CRM_Utils_Array::value( 'is_email_receipt', $form->_values ); - + //@todo - this is being set from the form to resolve CRM-10188 - an + // eNotice caused by it not being set @ the front end + // however, we then get it being over-written with null for backend contributions + // a better fix would be to set the values in the respective forms rather than require + // a function being shared by two forms to deal with their respective values + // moving it to the BAO & not taking the $form as a param would make sense here. + if(!isset($params['is_email_receipt'])){ + $params['is_email_receipt'] = CRM_Utils_Array::value( 'is_email_receipt', $form->_values ); + } $recurringContributionID = self::processRecurringContribution($form, $params, $contactID, $contributionType, $online); if (!$online && isset($params['honor_contact_id'])) { -- 2.25.1