Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 2.1
-
Fix Version/s: 2.1.2
-
Component/s: Core CiviCRM
-
Labels:None
Description
Entering a value with a comma in a custom field of type 'Money' causes a fatal error.
To recreate on the demo server:
1. Create a new custom group applicable to any object type
2. Add a field of type Money to the group
3. Edit an object with the new custom field and enter following values then Save to see responses:
a) "aaaa" -> Validation warning "Please correct the following errors in the form fields below: * <field> must be in proper money format. (decimal point/comma/space is allowed)." (CORRECT)
b) "1000" -> form saves (CORRECT)
c) "1,000" -> "Sorry. A non-recoverable error has occurred.1,000 is not of the type Money" (NOT CORRECT)
Desired behaviour is that commas and proper money formatting are accepted and value is saved.
PS. This is not directly related, but when looking into this bug I noticed that CRM_Core_BAO_CustomValueTable::store is called in numerous places in the code, even though the store function is not defined as static.