I have a small Umbraco site running on version 7.13.1 und am playing around a bit in version 8. The goal is to set up everything in v8 and continue development there.
Unfortunately, I'm having a bit of a problem with the decimal data type. I use it to store some values in our site and those values can also be negative. Everything worked flawlessly in v7, but in the v8 site I can't save and publish any content items with negative values in the decimal property. It always gives a validation error: "Property has errors"
If I manipulate the content in code (get an IContent through the ContentService, use the SetValue method on that object and then the SaveAndPublish method to save) I can input negative values in those properties and they then show up properly in the backend when viewing those content items. But I can't save them until I remove the minus in the textbox. I guess something in the validation is broken.
Anyone else run into this problem? And do you have any idea how to fix it?
Negative values for decimal show validation error
Hi everyone,
I have a small Umbraco site running on version 7.13.1 und am playing around a bit in version 8. The goal is to set up everything in v8 and continue development there.
Unfortunately, I'm having a bit of a problem with the decimal data type. I use it to store some values in our site and those values can also be negative. Everything worked flawlessly in v7, but in the v8 site I can't save and publish any content items with negative values in the decimal property. It always gives a validation error: "Property has errors"
If I manipulate the content in code (get an IContent through the ContentService, use the SetValue method on that object and then the SaveAndPublish method to save) I can input negative values in those properties and they then show up properly in the backend when viewing those content items. But I can't save them until I remove the minus in the textbox. I guess something in the validation is broken.
Anyone else run into this problem? And do you have any idea how to fix it?
Cheers, David
I think I found a fix:
In ~/Umbraco/Views/propertyeditors/decimal/decimal.html you need to change the pattern attribute of the input field to
That did the trick for me. Now decimal fields accept negative values.
is working on a reply...