Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure pay_later variables assigned to template #22971

Merged
merged 1 commit into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions CRM/Contribute/Form/Contribution/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -1400,12 +1400,10 @@ public function submit($params) {
// Would be nice to someday understand the point of this set.
$this->set('is_pay_later', $params['is_pay_later']);
// assign pay later stuff
$this->_params['is_pay_later'] = CRM_Utils_Array::value('is_pay_later', $params, FALSE);
$this->_params['is_pay_later'] = $params['is_pay_later'];
$this->assign('is_pay_later', $params['is_pay_later']);
if ($params['is_pay_later']) {
$this->assign('pay_later_text', $this->_values['pay_later_text']);
$this->assign('pay_later_receipt', CRM_Utils_Array::value('pay_later_receipt', $this->_values));
}
$this->assign('pay_later_text', $params['is_pay_later'] ? $this->_values['pay_later_text'] : NULL);
$this->assign('pay_later_receipt', ($params['is_pay_later'] && isset($this->_values['pay_later_receipt'])) ? $this->_values['pay_later_receipt'] : NULL);

if ($this->_membershipBlock && $this->_membershipBlock['is_separate_payment'] && !empty($params['separate_amount'])) {
$this->set('amount', $params['separate_amount']);
Expand Down
6 changes: 2 additions & 4 deletions CRM/Event/Form/Registration/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -985,10 +985,8 @@ public function postProcess() {
// assign pay later stuff
$this->_params['is_pay_later'] = CRM_Utils_Array::value('is_pay_later', $params, FALSE);
$this->assign('is_pay_later', $params['is_pay_later']);
if ($params['is_pay_later']) {
$this->assign('pay_later_text', $this->_values['event']['pay_later_text']);
$this->assign('pay_later_receipt', $this->_values['event']['pay_later_receipt']);
}
$this->assign('pay_later_text', $params['is_pay_later'] ? $this->_values['event']['pay_later_text'] : NULL);
$this->assign('pay_later_receipt', $params['is_pay_later'] ? $this->_values['event']['pay_later_receipt'] : NULL);

if (!$this->_allowConfirmation) {
// check if the participant is already registered
Expand Down