Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7.16
-
Fix Version/s: 4.7.17
-
Component/s: CiviContribute
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Contributed Code
-
Verified?:No
Description
here are the circumstances where I ran into this. I suspect there are other scenarios similar to this.
- create priceset with two fields, where one of them has a $0 amount
- create a contribution and select/enter options for the two fields. use payment method = check. this should result in a positive amount for the contrib, with line items listed where one of the line items is $0
- edit the contribution and change the payment method to credit card. the error occurs when creating the proportional amount for the civicrm_entity_financial_trxn record. I did not see the error occur when saving using other payment methods, but I'm not sure if that's because of core code or just my financial setup. changing the payment method triggered the relevant code where the problem took place.
the issue was with CRM_Contribute_BAO_Contribution::createProportionalEntry, which triggers the EntityFinancialTrxn api. the problem is that the $0 line_item_amount resulted in '0' for the 'amount' element in the api params, which triggered a "missing from params array: amont" error.