Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We now have #1174640: Add new HTML5 FAPI element: number and should use it instead of the textfield-with-"custom"-validation widget.
Comment | File | Size | Author |
---|---|---|---|
#5 | 1519852-number-widget-5.patch | 7.39 KB | Niklas Fiekas |
#5 | 1519852-number-widget-5-interdiff.txt | 1.64 KB | Niklas Fiekas |
#1 | 1519720-use-number-1.patch | 5.75 KB | Niklas Fiekas |
Comments
Comment #1
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedFirst try.
Comment #3
yched CreditAttribution: yched commentedSo the patch removes the "customizable decimal separator" feature altogether - which is some ugly/fragile piece of code.
How would that be handled by the HTML5 number element ? Does this rely on browser locale settings ?
Comment #4
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedThe browser must submit the value to the server with a dot.
On the client side, browsers can do whatever they want. Like helping the user by replacing "," with "." or doing such a replacement in the background, allowing only either of the two, etc.
Comment #5
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedUpdating tests with the changed user interface texts.
Comment #6
sunThis looks good to go for me.
I merely wonder how html4 user agents will be handled - i.e., browsers which don't support any auto-conversion/localization for the decimal separator and so on. However, we can figure that out later on.
AFAICS, number fields always store their values with the regular/native decimal separator, so it also doesn't look like we need a update function here.
Comment #7
yched CreditAttribution: yched commentedWe'd probably need an update function to remove the 'decimal_separator' setting from the definitions of existing decimal and float fields. No need to keep useless entries rotting in there.
Comment #8
Niklas Fiekas CreditAttribution: Niklas Fiekas commented@sun: Users would have to use a "." - otherwise the input will be rejected.
Comment #9
Dries CreditAttribution: Dries commentedLooks good and committed to 8.x. Thanks.