Number field input validation does not respect decimal separator setting
Overview
This issue has to do with "number" (float) custom fields on some edit forms. When you enter a number containing any character other than a digit or a period (full stop) into such a field, validation fails. This happens even if the offending character has been set as the decimal separator in Civi's localization settings.
Reproduction steps
- Under Administer > Localization > Languages, Currency, Locations, set "Decimal Delimiter" to "," (comma).
- Create a custom field extending Activities. Data type: Number.
- Add a new activity. In the number field, enter a number that includes a comma, such as "123,45" (one hundred twenty three and forty-five one-hundredths).
- Press Save.
Current behaviour
Validation fails with the error message "[Custom Field Label] must be a number (with or without decimal point)."
Expected behaviour
The form should save the entered amount as (float) one hundred twenty three and forty-five one-hundredths.
Environment information
CiviCRM 5.60 (current master HEAD).
Comments
Somewhat entangled with #4152 (closed)