-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
Further deprecate use of $ids array in membership functions #14887
Further deprecate use of $ids array in membership functions #14887
Conversation
(Standard links)
|
@@ -356,14 +349,22 @@ public static function create(&$params, &$ids = [], $skipRedirect = FALSE) { | |||
//record contribution for this membership | |||
if (!empty($params['contribution_status_id']) && empty($params['relate_contribution_id'])) { | |||
$memInfo = array_merge($params, array('membership_id' => $membership->id)); | |||
$params['contribution'] = self::recordMembershipContribution($memInfo, $ids); | |||
$params['contribution'] = self::recordMembershipContribution($memInfo); |
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.
It seems that we are no longer passing in $ids['contribution'] & nor are we passing in $memInfo['contribution_id'] so we might need to be loading & passing that in instead?
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.
$ids['contribution'] can only be set if we've already called CRM_Member_BAO_Membership::create()
which we haven't, as we're calling this from create()
Arguably we don't need the $params['contribution_id']
check in recordMembershipContribution()
as I think it will always be empty, but it seemed sensible given the need for further refactoring in this area.
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.
I'm confused - if $ids['membership'] is set & it's an update the $ids['membership'] would be set so it would load $ids['contribution'] in the rows above (before your removal)
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.
:-( Looks like I am too... Have undone a bit of the refactor so we set $params['contribution_id']
before calling self::recordMembershipContribution
. I'm still pretty sure that neither $ids['contribution'
or $params['contribution_id']
will be set at this point but the code is now less "risky" for a first round.
I think we do have pretty good test cover here |
0766c5f
to
a01c34d
Compare
@eileenmcnaughton I've reviewed (and resolved) your comments. I've added a load more comments reflecting the work I did to track where |
@eileenmcnaughton Try again :-) |
changes look fine to me now @mattwire can you squish your commits together please |
113706d
to
f57cb50
Compare
@seamuslee001 @eileenmcnaughton Squashed! |
unrelated fail |
Overview
Incremental progress towards removing deprecated code.
Before
$ids
passed in more places.After
$ids
passed in less places.Technical Details
Comments
@eileenmcnaughton per similar work you've done