-
-
Notifications
You must be signed in to change notification settings - Fork 824
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] Extract & stdise AmountBlockIsActive #22291
Conversation
(Standard links)
|
@@ -487,8 +487,7 @@ public function buildQuickForm() { | |||
$this->buildCustom($this->_values['honoree_profile_id'], 'honoreeProfileFields', TRUE, 'honor', $fieldTypes); | |||
} | |||
$this->assign('receiptFromEmail', $this->_values['receipt_from_email'] ?? NULL); | |||
$amount_block_is_active = $this->get('amount_block_is_active'); |
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.
set in preProcess - but preProcess also ensure the _values value is set so why have 2 ways?
} | ||
// This can probably go as nothing it 'getting it' anymore since the values data is loaded | ||
// on every form, rather than being passed from form to form. | ||
$this->set('amount_block_is_active', $this->isFormSupportsNonMembershipContributions()); |
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.
I was in 2 minds on commenting vs removing
01a312c
to
494015b
Compare
@@ -365,7 +365,6 @@ public function preProcess() { | |||
|
|||
// this avoids getting E_NOTICE errors in php | |||
$setNullFields = [ | |||
'amount_block_is_active', |
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.
Since the function to interact with this handles the possibility of it not being set we don't need this enotice prevention
494015b
to
5b613e7
Compare
It took me a bit to figure out what it even meant - so extracted into a function which can provide explanation. Part of trying to stop passing known values around - see pass to isSeparateMembershipTransaction - that function should require no input params & be callable with consistent results anywhere
5b613e7
to
1bec3b5
Compare
thanks @mattwire |
Overview
[REF] Extract & stdise AmountBlockIsActive
Before
The amount_block_is_active value is a bit of a mystery. I had to deep dive to figure out what it meant.
After
The value is accessed from a more descriptive function and the comment block provides more detail
Technical Details
Part of trying to stop passing known values around and rather retrieve them via functions - eg pass to isSeparateMembershipTransaction
Comments