Handle possibility of fee_amount = ''
authoreileen <emcnaughton@wikimedia.org>
Fri, 4 Dec 2020 21:17:17 +0000 (10:17 +1300)
committereileen <emcnaughton@wikimedia.org>
Fri, 4 Dec 2020 21:17:40 +0000 (10:17 +1300)
CRM/Contribute/BAO/Contribution.php

index b7bbf5f323715235ec3f5d1d65d12254eb2e71e6..74694231bf3a13ae033c1ad2af7633ea7471734d 100644 (file)
@@ -343,7 +343,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
    * @throws \CiviCRM_API3_Exception
    */
   public static function calculateMissingAmountParams(&$params, $contributionID) {
-    if (!$contributionID && !isset($params['fee_amount'])) {
+    if (!$contributionID && (!isset($params['fee_amount']) || $params['fee_amount'] === '')) {
       if (isset($params['total_amount']) && isset($params['net_amount'])) {
         $params['fee_amount'] = $params['total_amount'] - $params['net_amount'];
       }