U4-1314 - numeric property validation not working (not displaying error) and old number saved (instead of new one)

Created by firepol 11 Dec 2012, 14:55:08 Updated by Shannon Deminick 21 Jun 2017, 07:58:15

Relates to: U4-366

Relates to: U4-1349


I know there is a similar issue that was fixed in 4.10 (http://issues.umbraco.org/issue/U4-366)

The thing is that I just tested this on 4.10.1 and 4.11.1 and still its not working, so I'm reopening the bug.

I have a document type with a "price" numeric property, not mandatory.

When I edit a node which has already a value (e.g. 100) for the price, and remove the value (empty input box) and save, instead of having a node with empty price, the node is saved with the old price!

Expected behavior: node is saved and price is set to empty string ""/null value.

Also, if I insert other characters than digits after the number, e.g. price followed by currency (I'm trying to simulate the user who has no knowledge of the system), e.g. 900 USD, and save, the old price is saved: 100 and no error message is displayed. (Totally wrong behavior).

Expected behavior: a red/validation error is displayed, telling that the field has no valid data.

I tried to use a regular expression, such as ^(?:[0-9]{1,5})$ (to allow empty value, or number with 1 up to 5 digits):

If I try to enter 109991 (6 digits) I get this error: Your data has been saved, but before you can publish this page there are some errors you need to fix first: Number at Properties is not in a correct format

This is ok, good job, at least the regular expression seems to be checked.

But if I enter a value such as 123 usd, the old value (100) is saved, and no error message is displayed.

'''The bug is''': if a '''number is followed by a space and some text''', and the user tries to "save" or "save and publish", there is '''no validation check''' and '''the node is saved simply with the previous (old) value'''.

Thank you for fixing this.


Shannon Deminick 21 Jun 2017, 07:58:15

Closing issue due to inactivity - see blog post for details https://umbraco.com/blog/issue-tracker-cleanup/

Priority: Normal

Type: Bug

State: Closed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions: 4.10.0, 4.11.0, 4.11.1

Due in version:


Story Points: