-
-
Notifications
You must be signed in to change notification settings - Fork 828
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] Cleanup CRM_Member_BAO_Membership::buildMembershipTypeValues #16059
Conversation
(Standard links)
|
17e8ef5
to
fc694f0
Compare
list($MembershipRenew) = CRM_Member_BAO_Membership::processMembership( | ||
$contactId, | ||
$this->_membershipTypeID, | ||
FALSE, | ||
$membershipRenewal, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This param is a bool!
@@ -811,7 +808,7 @@ public function testMembershipPaymentForSingleContributionMultipleMembership() { | |||
$parentContactId = $this->individualCreate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test actually didn't pass in isolation for set-up related reasons
* | ||
* @throws \CiviCRM_API3_Exception | ||
*/ | ||
public function testBuildMembershipTypeValues() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here is the new testt
e62e12a
to
f04b9c2
Compare
@eileenmcnaughton 2 of the test failure look like they relate |
f04b9c2
to
7d9b0df
Compare
This simplifies this function & switches it to use a cached function to get the MembershipTypes. In general I would argue that we should be caching metadata entities (membership types, statues, price fields, etc) and accessing the cached versions & ideally the v4 api would be able to access cached versions filter-dependent. In order to keep the test passing I worked a little on standardisation
7d9b0df
to
322b59f
Compare
@seamuslee001 this has passed now |
Useful step in the right direction |
Overview
Fixes function to be more readable, use caching & return more data
Before
After
Technical Details
This is towards a fix for #15895 - I hit #16058 in the process. It doesn't fix #15895 but it points towards the solution which, to my mind, is assigning more useful values to the template & doing less in javascript. The next step is to use the correct tax_rate rather than have to use 2 arrays just to get the tax_rate - ie
eileenmcnaughton@458a559#diff-fa0276456bc05f4629f775e6846f62ed
However, following that we can have the js use the figure which includes the tax, rather than having to calculate that in js with unknowns to deal with
Comments
Anything else you would like the reviewer to note