Fix fatal error when selecting a /bin/bash price option.
authoreileen <emcnaughton@wikimedia.org>
Wed, 4 Apr 2018 05:52:14 +0000 (17:52 +1200)
committereileen <emcnaughton@wikimedia.org>
Wed, 4 Apr 2018 05:52:14 +0000 (17:52 +1200)
The code for creating a new price option creates a new financial transaction but when choosing a /bin/bash price option
it fails as the api does not accept /bin/bash EntityFinancialTrxn, skip if /bin/bash

CRM/Price/BAO/LineItem.php

index e85866fd61bc8dd7f116c66c8befae493050aadf..c2ea32d0cec9892e46e92f7c65ea5efff9ff44f2 100644 (file)
@@ -766,7 +766,7 @@ WHERE li.contribution_id = %1";
           ));
           unset($updateFinancialItemInfoValues['financialTrxn']);
         }
-        elseif (!empty($updateFinancialItemInfoValues['link-financial-trxn'])) {
+        elseif (!empty($updateFinancialItemInfoValues['link-financial-trxn']) && $newFinancialItem->amount != 0) {
           civicrm_api3('EntityFinancialTrxn', 'create', array(
             'entity_id' => $newFinancialItem->id,
             'entity_table' => 'civicrm_financial_item',