-
-
Notifications
You must be signed in to change notification settings - Fork 827
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
Conversation
This just removes the duplicate assign codes & simplifies the /bin/bash condition
(Standard links)
|
@@ -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'] |
There was a problem hiding this comment.
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?
} | ||
$this->assign('button', $contribButton); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes to these changes.
@eileenmcnaughton This is good to merge pending my comments about the comments. |
@mattwire I'm gonna merge this as a simplification - I'm not quite sure what to put in the 'comments' as yet because part of my hope is that we can simplify further - ie. can we get away from having 3 different button names? |
Overview
Very minor code simplification
Before
Code less readable
After
Code more readable
Technical Details
This just removes the duplicate assign codes & simplifies the <=0 condition
Comments