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] Simplify logic on calling self::updateContributionStatus #18357

Merged
merged 1 commit into from
Sep 5, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Minor code simplification

Before

First $contributionStatusId is set in exactly one place. Later it is the condition for calling self::updateContributionStatus

After

Call self::updateContributionStatus rather that using a variable as a 'note to self'

Technical Details

self::updateContributionStatus is only called when contributionStatusId has been set - there is only
one place that is set so move the code up there rather than set a param to trigger action further down

Comments

self::updateContributionStatus is only called when contributionStatusId has been set - there is only
one place that is set so move the code up there rather than set a param to trigger action further down
@civibot
Copy link

civibot bot commented Sep 4, 2020

(Standard links)

@civibot civibot bot added the master label Sep 4, 2020
@@ -268,7 +268,7 @@ public static function updatePendingOnlineContribution($participantId, $statusId
$contributionId = CRM_Contribute_BAO_Contribution::checkOnlinePendingContribution($participantId,
'Event'
);
if (!$contributionId) {
if (!$contributionId || !$participantId) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved this up from lower down. It's actually impossible for it to be false but I thought I'd clarify that next round of cleanup by using type checking

@eileenmcnaughton
Copy link
Contributor Author

test this please

@seamuslee001
Copy link
Contributor

This looks fine to me merging

@seamuslee001 seamuslee001 merged commit 30bd3f9 into civicrm:master Sep 5, 2020
@eileenmcnaughton eileenmcnaughton deleted the fail branch September 5, 2020 02:46
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