Remove legacy handling for 'fixing' line_item.entity_id
authoreileen <emcnaughton@wikimedia.org>
Sat, 15 Aug 2020 04:52:40 +0000 (16:52 +1200)
committereileen <emcnaughton@wikimedia.org>
Sat, 15 Aug 2020 05:14:22 +0000 (17:14 +1200)
commit89e65e3e1e1eabf7383d9b07f711de9fa426a938
tree0672a5ae812c9ec2d0544c16760d0e78ef26a3cf
parente1c19eaf61ecb9bd0119ee438deb42417b8abbf3
Remove legacy handling for 'fixing' line_item.entity_id

I tried to see what was happening with the test in https://github.com/civicrm/civicrm-core/pull/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. https://github.com/civicrm/civicrm-core/pull/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
CRM/Price/BAO/LineItem.php
tests/phpunit/CRMTraits/Financial/OrderTrait.php
tests/phpunit/api/v3/MembershipTest.php