- 🇬🇧United Kingdom c_archer Cumbria
I can confirm patch #29 allows you to save the a number with a 0 but this in then removed on saving to the db.
- last update
almost 2 years ago 29,303 pass, 1 fail - last update
almost 2 years ago 29,304 pass - Status changed to Needs review
almost 2 years ago 4:24am 25 April 2023 - last update
almost 2 years ago 29,300 pass - last update
almost 2 years ago 29,295 pass, 2 fail - 🇮🇳India ranjith_kumar_k_u Kerala
moved tests from the following function
Drupal\Tests\field\FunctionalJavascript\Number::testNumberFormatter
to
Drupal\Tests\field\Functional\Number::testNumberIntegerField
I hope this is the correct place, please review The last submitted patch, 36: 3063300-36-test-only.patch, failed testing. View results →
- Status changed to Needs work
almost 2 years ago 2:21pm 25 April 2023 - 🇺🇸United States smustgrave
Still needs an issue summary update.
Also test appears to be only testing 1 field type. Think the test could be in NumberItemTest to cover floats, ints, and decimals.
- 🇮🇳India ranjith_kumar_k_u Kerala
The problem only exists in the Number(integer) field type, the other field types Number(decimal), Number(float) are allowing the values with leading zero.
- 🇮🇳India asha nair
Applied patch #36 successfully. The patch allows values with leading zeros in integer type number field.
I think it makes more sense to attach JS to the form and remove leading zeros "on blur" event for the field.
01
is not a valid integer representation; it's a string. Leading zeros won't be stored in the value in the DB if it uses a true PHP integer, and it's even a bit confusing I'd think, since the value would be different than what is entered.