Merge pull request #16429 from ixiam/dev/core#1113
authorEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 17 Jul 2020 00:52:57 +0000 (12:52 +1200)
committerGitHub <noreply@github.com>
Fri, 17 Jul 2020 00:52:57 +0000 (12:52 +1200)
dev/core#1113 - Decimal Separator - Invalid value "total_amount" (NaN,N) creating or editing a membership

1  2 
CRM/Member/Form/Membership.php

index 007971bf21819c9be6b63d6f544b9e9622bcdb88,2cb7f837b1979aeafc73b8195b9bf128f76a0304..88e21e4025d76abb7b92eb87d08e932c1625ee9a
@@@ -491,13 -498,13 +491,13 @@@ class CRM_Member_Form_Membership extend
            $selOrgMemType[$memberOfContactId][0] = ts('- select -');
          }
          if (empty($selOrgMemType[$memberOfContactId][$key])) {
 -          $selOrgMemType[$memberOfContactId][$key] = CRM_Utils_Array::value('name', $values);
 +          $selOrgMemType[$memberOfContactId][$key] = $values['name'] ?? NULL;
          }
        }
 -      $totalAmount = CRM_Utils_Array::value('minimum_fee', $values);
 +      $totalAmount = $values['minimum_fee'] ?? NULL;
        //CRM-18827 - override the default value if total_amount is submitted
        if (!empty($this->_submitValues['total_amount'])) {
-         $totalAmount = $this->_submitValues['total_amount'];
+         $totalAmount = CRM_Utils_Rule::cleanMoney($this->_submitValues['total_amount']);
        }
        // build membership info array, which is used when membership type is selected to:
        // - set the payment information block