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

[REF] minor code simplification - remove over-handling of amount comp with zero #13783

Merged
merged 1 commit into from
Mar 12, 2019
Merged
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
7 changes: 2 additions & 5 deletions CRM/Contribute/Form/Contribution/Confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,20 +596,17 @@ public function buildQuickForm() {
// the is_monetary concept probably should be too as it can be calculated from
// the existence of 'amount' & seems fragile.
if ($this->_contributeMode == 'notify' ||
$this->_amount < 0.0 || $this->_params['is_pay_later'] ||
($this->_separateMembershipPayment && $this->_amount <= 0.0)
$this->_amount <= 0.0 || $this->_params['is_pay_later']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worst case we'd end up with the wrong text on a button so this is pretty low risk! What would we need to do to get rid of _contributeMode here?

Also, looks like the is_monetary comment no longer applies and should be removed. Can the _contributeMode comment get a fixme/todo tag?

) {
$contribButton = ts('Continue');
$this->assign('button', ts('Continue'));
}
elseif (!empty($this->_ccid)) {
$contribButton = ts('Make Payment');
$this->assign('button', ts('Make Payment'));
}
else {
$contribButton = ts('Make Contribution');
$this->assign('button', ts('Make Contribution'));
}
$this->assign('button', $contribButton);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes to these changes.

$this->addButtons(array(
array(
'type' => 'next',
Expand Down