Remove legacy handling for 'fixing' line_item.entity_id #18155
Merged
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
Removes code deprecated in 2018 that causes the entity_id on a line item attached to a membership to be incorrect in edge circumstances, in an attempt to fix it in other edge cases. The deprecation notice has never been 'noticed' so is probably not hit
Before
When an Order is created with 2 line items, each linked to a membership (in this case linked to different contact ids) the second line item is altered to have the same membership id as the first. A deprecation notice is hit
After
Line items unchanged in processPriceSet
Technical Details
I tried to see what was happening with the test in #18113
and spotted that it wasn't using Order.api so the line items were likely wrong. However, once I set
it up to use the Order api I found the code we added back in 2018 to attempt to cope with other code
setting entity_id incorrectly was actually itself setting entity_id incorrectly. The issue
happens when there are 2 Memberships linked to one contribution & the removed code 'decides'
one is wrong and alters it. #11816
This line of code throws a deprecation notice - which has not been reported / apparently seen in the last
couple of years so I'm assuming it's not actually doing any good and without removing it this test actually
fails
Comments