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

Remove always true if #18801

Merged
merged 1 commit into from
Oct 20, 2020
Merged

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Oct 19, 2020

Overview

Follow on to #18790 - remove always-true IF

Before

Code wrapped in if ($paymentProcessorObj) { - but that will always be true as the manual processor is returned if no id

After

poof

Technical Details

Since paymentProcessorObj is loaded as the manual processor where another does not exist
the processor condition is always true - so this if is obsolete

Comments

This is in it's own PR for whitespace readability reasons - the other IF should also be obsolete so that would be the next follow up

Since paymentProcessorObj is loaded as the manual processor where another does not exist
the processor condition is always true - so this if is obsolete
@civibot
Copy link

civibot bot commented Oct 19, 2020

(Standard links)

@civibot civibot bot added the master label Oct 19, 2020
@seamuslee001
Copy link
Contributor

@eileenmcnaughton what happens if CRM_Contribute_BAO_ContributionRecur::getPaymentProcessorID($recurID) can't find a PaymentProcessorID?

@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 Civi\Payment\System::singleton()->getById will return the manual processor if id is empty

@seamuslee001
Copy link
Contributor

Looks fine to me then merging

@seamuslee001 seamuslee001 merged commit 42dada1 into civicrm:master Oct 20, 2020
@seamuslee001 seamuslee001 deleted the canceltest branch October 20, 2020 00:35
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.

2 participants