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

Extract getMembershipBlock #25238

Merged
merged 1 commit into from
Jan 2, 2023
Merged

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Extract getMembershipBlock

Before

The code to getMembershipBlock is buried in a bigger if

After

It is extracted

Technical Details

Because the function now handles 'calculate if not already calculated' we can move it below the if which means we can also remove the get to grab it again a few lines further down. There is a legacy pattern where calculated values were passed around within the form & from form to form, either because they (incorrectly) thought the work involved in calculating them was enough to justify it or ... just cos. But in this case if you know the contribution page you can figure out the block - there is no dependency on the formValues

This is part of my effort to make sense of these variales #25181

Comments

@civibot
Copy link

civibot bot commented Dec 29, 2022

(Standard links)

@civibot civibot bot added the master label Dec 29, 2022
@mattwire mattwire merged commit 8373608 into civicrm:master Jan 2, 2023
@eileenmcnaughton eileenmcnaughton deleted the is_separate branch January 2, 2023 09:55
@eileenmcnaughton
Copy link
Contributor Author

thanks @mattwire

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