-
-
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] Follow up clean up - remove contribution_mode #20656
Conversation
Contribution mode was only set to be used to set isRelatedID here https://github.com/civicrm/civicrm-core/pull/20653/files#diff-4c9d0b1abe07057a4eea2b47bc627eecb95face8ed8d86c1c005312a52cca811L3420 but we removed that....
(Standard links)
|
@eileenmcnaughton Woah, cool! I was just about to open an issue about this. Glad to see it's being stripped out. Am I right in thinking that Additionally (just FYI) in the 1 Membership + 1 Participant scenario, the Membership "mode" took priority and so the Participant record was never updated to "Registered". |
@eileenmcnaughton Follow-up to the above FYI: The behaviour without removing Hope that helps disentangle this. |
@christianwach so my understanding of the reason for 'mode' was that line items were not being passed correctly to recordFinancialAccounts originally so it was using an assumption-based-approach to determine what they should be Can I summarise your comments by saying 'this PR improves things but there is still a bug afterwards? |
I should note - I haven't figured out what is going on with mode when used in the participant context yet - I had concluded it was not a good thing in the membership context & was going to dig a bit more & see if it does anything useful once this part was sorted |
@eileenmcnaughton I'm not sure TBH... I haven't been able to test with the removal of I'll start testing with |
I'm trying to simplify the Order api usage a bit #20681 so I can fix a few more tests to use it - then I can start throwing in a few more deprecation notices in places like this https://github.com/civicrm/civicrm-core/pull/20678/files#diff-a16d4d7449cf5f3a0616d1d282a32f27ab6d3f7d2726d076c02ad1d4d655af41R395 |
@@ -1585,9 +1585,6 @@ protected function submit($submittedValues, $action, $pledgePaymentID) { | |||
$params['participant_id'] = $pId; |
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.
@eileenmcnaughton why don't we also get rid of this assignment
- $params['contribution_mode'] = 'participant';
And later in Contribution::create
- if (CRM_Utils_Array::value('contribution_mode', $params) == 'participant') {
+ if (!empty($params['participant_id'])) {
$entityId = $params['participant_id'];
$entityTable = 'civicrm_participant';
$additionalParticipantId = CRM_Event_BAO_Participant::getAdditionalParticipantIds($entityId);
}
elseif (!empty($params['membership_id'])) {
//so far $params['membership_id'] should only be set coming in from membershipBAO::create so the situation where multiple memberships
// are created off one contribution should be handled elsewhere
$entityId = $params['membership_id'];
$entityTable = 'civicrm_membership';
}
else {
$entityId = $params['contribution']->id;
$entityTable = 'civicrm_contribution';
}
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.
@monishdeb I'm happy to - I didn't remove it because I haven't worked through anything on the participant side yet & am only focussing on membership so far - I was going to switch my focus once the current PRs are merged
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.
Acutally that is not quite true - I had started on the participant side over here #20650 & I wanted to get that additional test cover before going further on it
Tested earlier in local, till then no changes have been made. Reviewed the patch .. all looks good. Merging now |
Overview
Removes legacy parameter
Before
'contribution_mode' set to reflect line item 'type' but no longer used for membership
After
poof
Technical Details
Contribution mode was only set to be used to set isRelatedID
here https://github.com/civicrm/civicrm-core/pull/20653/files#diff-4c9d0b1abe07057a4eea2b47bc627eecb95face8ed8d86c1c005312a52cca811L3420
but we removed that....
Comments
@monishdeb can you check this?