-
-
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
Stop passing $ids to membership::create #26373
Conversation
(Standard links)
|
@mattwire Jenkins says "failed to apply patches". |
Thanks,. fixed |
Note that this actually results in a behaviour change - see civicrm-core/CRM/Member/BAO/Membership.php Lines 344 to 354 in f5fef76
I can't recall the impact - I did remove it from a bunch of places in the past but there was something scary about this one |
@eileenmcnaughton Does it actually change anything though? If you look at the calling code in |
I put this up to see ... #26401 |
SO it seems from my test it DOES hit that line - I'm just not quite sure what happens as a result Exception : CRM_Core_Exception: "should be unreachable Caller: ::civicrm_api3_membership_create" |
@eileenmcnaughton Your test is checking if any code passes in |
@mattwire where is it being set? I see it in the payment processor section but not sure where it is being set leading up to this line (of course I don't know if it is really a good thing for it to be set but that is a different question) |
@eileenmcnaughton It's a bit confusing and the submit function probably should be split into two because there's a big civicrm-core/CRM/Member/Form/Membership.php Line 1086 in 9afc564
which says "if mode is set" (could be live or test I think) follow the "has a payment associated" flow. civicrm-core/CRM/Member/Form/Membership.php Line 1164 in 9afc564
If you follow the other "flow" ie. civicrm-core/CRM/Member/Form/Membership.php Line 1260 in 9afc564
then it assumes there is no contribution associated. If a contribution is to be created it will only exist after the call to |
OK @mattwire I think this is something of an understatement "It's a bit confusing " But I can follow your argument now and I can't see another path |
Overview
We don't need to pass $ids to membership::create on membership form because membership ID is already set in
$membershipParams
.Before
$ids passed
After
$ids not passed
Technical Details
Comments
@eileenmcnaughton this probably makes most sense to you...