dev/membership#21 Fix regression causing transfer of membership to another contact if they paid #16047
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Fixes a bug where a membership associated with a contact is transferred to the contact who paid for it on edit, if that contact is different.
Before
3. Go to edit the relationship -note the wrong contact name
4. Edit the end date & save - membership has been transferred to the contact who paid for he membership
After
Contact remains attached to the correct member
Technical Details
This is a regression from work @yashodha did in ac0ef1d to improve form consistency.
Reverting that change fixes this. However, I don't propose we do that because it's a good change and the lines I propose to remove follow a known bad pattern - merging a bunch of parameters into a bunch of parameters with no clarity about what the reason is or why. In fact most of the remove lines exist to reverse the changes made in
CRM_Contribute_BAO_Contribution::getValues($contributionParams, $defaults, $contributionIds);
I couldn't see any negative impact on the renew form & the fields being defaulted didn't even show up on edit
Comments
The gitlab also refers to editing by webform - not sure what that is about