-
-
Notifications
You must be signed in to change notification settings - Fork 824
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 code calculating the number of membership terms #19801
Conversation
(Standard links)
|
08dcdb9
to
8534621
Compare
test this please |
8534621
to
eac2fd2
Compare
test this please |
We have 2 possibilities 1) there is a price set in use - the number of line items comes from the calculated line items 2) default priceset in use - it is a submitted value The option to submit is only present in 2 so we know that if it is submitted it should take precedence, otherwise it comes from the line item This simplifies the code to do that clearly
eac2fd2
to
e84c5dc
Compare
@colemanw this is one I'm keen to get merged (it's on the path to exposing Membership as a v4 api) |
Rather than rely on these being passed around retrieve them with a consistent function. Note tax_amount is retrieved one other place but that is fixed in civicrm#19757 Line item will be used less once civicrm#19801 is merged
@colemanw @demeritcowboy this one is also touching on the membership mess .... |
I don't really know how to review this properly so I just ran some backend membership forms and step-debugged these spots to see if they were doing anything obviously crazy.
|
@demeritcowboy getForm() should run preProcess so it's a duplication |
Ah I see - local getForm vs the "usual" getFormObject. 👍 |
Overview
[REF] Simplify code calculating the number of membership terms
Before
Yeah what IS going on in the code
After
Thash better
Technical Details
We have 2 possibilities
The option to submit is only present in 2 so we know that if it is
submitted it should take precedence, otherwise it comes from the line item
This simplifies the code to do that clearly
Comments