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

CRM/Contribute - Cleanup boolean expressions #16853

Merged
merged 1 commit into from
Mar 22, 2020

Conversation

colemanw
Copy link
Member

Broken out from #16814.

@civibot
Copy link

civibot bot commented Mar 19, 2020

(Standard links)

@civibot civibot bot added the master label Mar 19, 2020
@@ -1683,7 +1683,7 @@ protected function submit($submittedValues, $action, $pledgePaymentID) {
$action,
$pledgePaymentID,
$contribution->id,
(CRM_Utils_Array::value('option_type', $formValues) == 2) ? TRUE : FALSE,
($formValues['option_type'] ?? 0) == 2,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the only one I'm not 100% sure about @eileenmcnaughton thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's the same logic in both expressions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes - it first resolved $formValues['option_type'] to it's value OR 0 and then compares with 2

Copy link
Contributor

Choose a reason for hiding this comment

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

Guess it just seemed odd to me resolving to 0 when CRM_Utils_Array::value would have resolved to NULL but i guess for this purpose they are interchangeable values

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep - probably NULL would have been more readable

@eileenmcnaughton eileenmcnaughton merged commit 7f89fb6 into civicrm:master Mar 22, 2020
@eileenmcnaughton eileenmcnaughton deleted the bool3 branch March 22, 2020 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants