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 another call to deprecated CRM_Contribute_PseudoConstant::contributionStatus #24590

Merged
merged 2 commits into from
Nov 29, 2022

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Remove another call to deprecated contributionStatus

Before

$contributionStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');

After

  $newContributionStatus = CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $newContributionValues['contribution_status_id']);
    $oldContributionStatus = CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $oldContributionValues['contribution_status_id']);

Technical Details

This function is only called from two places in the universe so I gave it a bit of a cleanup too.
I have a feeling php might be deprecating pass-by-ref variables after non-reference variables in a future version (not sure about that) - but it was pretty fugly anyway

image

Comments

Hundreds of tests pass through this code

@civibot
Copy link

civibot bot commented Sep 22, 2022

(Standard links)

@civibot civibot bot added the master label Sep 22, 2022
@eileenmcnaughton eileenmcnaughton changed the title Remove another call to deprecated contributionStatus Remove another call to deprecated CRM_Contribute_PseudoConstant::contributionStatus Sep 22, 2022
@eileenmcnaughton
Copy link
Contributor Author

Yeah - as I mentioned test cover

api_v3_ContributionTest::testCreateUpdateContributionInValidStatusChange
api error message not as expectedWe expected a failure for contribution create but got a success:
Failed asserting that 'Cannot change contribution status from %1 to %2.' contains "Cannot change contribution status from Completed to Pending.".

@yashodha
Copy link
Contributor

@eileenmcnaughton you might want to squash the commits

@eileenmcnaughton
Copy link
Contributor Author

@yashodha I think they might be better not squashed - the second commit was just some removal of abbreviations to make the code more readable (& to not set off IDE spell checkers) but it stands alone

@seamuslee001 seamuslee001 merged commit fadcb48 into civicrm:master Nov 29, 2022
@seamuslee001 seamuslee001 deleted the cont branch November 29, 2022 03:33
@eileenmcnaughton
Copy link
Contributor Author

thanks @seamuslee001

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