getting trace back when browsing contributions for a given record
When I click on the contributions tab for a contact, I get the following error:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Type error: Argument 1 passed to CRM_Financial_BAO_Order::setPriceSetID() must be of the type int, null given, called in /var/www/powerbase/sites/all/modules/civicrm/CRM/Financial/BAO/Order.php on line
905
Technically this is a regression from the 5.39 -> 5.45 ugprade, but I think the real problem is that there is something wrong with the data for the given database.
I traced the problem to CRM/Financial/BAO/Order::calculateLineItems()
We pick off the most recent contribution for a given recurring contribution, review the line items, and then try to set the price set id from the line item's price_field_id
.
I think the change biting us is from @eileen's 4df23f2a. But the underlying problem is that this database has about 4,000 line items (out of 16,000) in which the price_field_id
is set to NULL. If I set it to 1 (the default contribution price set field) it works.
I think price_field_id
should never be null - is that right? Or, is this a bug in CiviCRM?