Number field input validation does not respect decimal separator setting (event custom field)
Overview
This is a variant of #4154 (closed), regarding custom fields for events of type This iPlease describe your problem or bug in detail.
If you have already posted on https://civicrm.stackexchange.com or https://chat.civicrm.org, please include the link to that conversation.
Reproduction steps
- Under Administer > Localization > Languages, Currency, Locations, set "Thousands Separator" to "." (dot) and "Decimal Delimiter" to "," (comma).
- Create a custom field extending Events. Data type: Number.
- Edit an existing event (or: add a new event). In the number field, enter a number that includes a comma, such as "1,5".
- Press Save: nothing happens
- Reload page: Error message appears "Error One of parameters (value: 1,5) is not of the type Float"
Current behaviour
Validation fails with the error message "Error One of parameters (value: 1,5) is not of the type Float"
Expected behaviour
Validation should not fail for decimal numbers with decimal separator ","
Environment information
- CiviCRM: 5.69.3
- PHP: 7,4, 8.1
- CMS: Drupal, WordPress
Comments
This bug was fixed for some fields with #4154 (closed) (https://github.com/civicrm/civicrm-core/pull/28369)
Also, I believe this is some kind of regression, because in a system of one of my clients, this did work ~15 months ago. However, tbh I have no clear idea when it broke. (and still, it cannot completely excluded that the existing data was entered with decimal separator ".")