Fix order api to set price field value for default price set
authorEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 27 Jul 2021 23:37:00 +0000 (11:37 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 28 Jul 2021 00:59:41 +0000 (12:59 +1200)
commit60e5cf3432f2aed4768645c9ab9eb1399e3345c9
tree7d33156aadb9767d2243108e3114355d97b8875f
parent8e851c62d2bd6ef0a1d52dfcc62d4d2f4331f2ed
Fix order api to set price field value for default price set

This makes it such that when using the default price set for contributions it not only
fills the default price field id. I originally had this in the code but I pulled it out
because the line item test failed. However, I'm seeing cases where not
having a price_field_value_id fails to add tax and I think the issue with the line item
test is that it is, incorrecly, trying to add 2 line items on the price field in
the default price set - which is not actually the expectation on the default price set

I do, separately, wonder if we need the unique id for price_field_id + contribution_id
+ price_field_value_id - but out of scope on this
CRM/Financial/BAO/Order.php
ext/financialacls/tests/phpunit/Civi/Financialacls/BaseTestClass.php
ext/financialacls/tests/phpunit/Civi/Financialacls/LineItemTest.php
tests/phpunit/api/v3/OrderTest.php