Fixes getTemplateContribution to use a more reliable way to load line items
authorEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 6 Jul 2021 18:54:32 +0000 (06:54 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 12 Jul 2021 03:25:46 +0000 (15:25 +1200)
commit4df23f2a270c08bc42fd1ff93fcfe318ecdc0e19
treebf27b3e9e2b639cbe298739054b90bef99dc5cf7
parent09e790b7a8ad75c107ff6eb9cf0f0f6f93856956
Fixes getTemplateContribution to use a more reliable way to load line items

My efforts to add testing a 'deprecate weird stuff' have identified an odd and fragile
flow for the line items in getTemplateContribution. It calls
getLineItemsByContributionID which, as it turns out, substitues the
actual entity table with 'civicrm_contribution'.

Then this line of weird handling swoops in and saves the day.

https://github.com/civicrm/civicrm-core/pull/20775/files#diff-a16d4d7449cf5f3a0616d1d282a32f27ab6d3f7d2726d076c02ad1d4d655af41R393

This switches us to something cleaner than just loads the line items (with v4 LineItem.get) and
no weird handling
CRM/Contribute/BAO/Contribution.php
CRM/Contribute/BAO/ContributionRecur.php
CRM/Financial/BAO/Order.php
tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php
tests/phpunit/CRM/Core/Payment/PayPalIPNTest.php
tests/phpunit/CiviTest/CiviUnitTestCase.php
tests/phpunit/api/v3/ContributionTest.php