Skip to content
Snippets Groups Projects
Commit 238ea0e4 authored by jitendra's avatar jitendra
Browse files

#1255 - fix display of email address on pay later contribution

parent fe5aa2e8
Branches
Tags
No related merge requests found
......@@ -577,9 +577,16 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
}
$this->assignPaymentFields();
$this->assign('email',
$this->controller->exportValue('Main', "email-{$this->_bltID}")
);
if ($this->_emailExists && empty($this->_params["email-{$this->_bltID}"])) {
foreach ($this->_params as $key => $val) {
if (substr($key, 0, 6) == 'email-') {
$this->assign('email', $this->_params[$key]);
}
}
}
else {
$this->assign('email', CRM_Utils_Array::value("email-{$this->_bltID}", $this->_params));
}
// also assign the receipt_text
if (isset($this->_values['receipt_text'])) {
......
......@@ -84,9 +84,11 @@ class CRM_Contribute_Form_Contribution_ThankYouTest extends CiviUnitTestCase {
$pageContribution = $this->getPageContribution((($withPendingContribution) ? 2 : 1), $isTestContribution);
$form = $this->getThankYouForm();
$form->_lineItem = [];
$form->_bltID = 5;
$form->_params['contributionID'] = $pageContribution['contribution_id'];
$form->_params['invoiceID'] = $pageContribution['invoice_id'];
$form->_params['email-5'] = 'demo@example.com';
$form->_params['payment_processor_id'] = $paymentProcessorID;
if ($isTestContribution) {
$form->_mode = 'test';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment