[72685] User can input anything in WP unit costs#22145
[72685] User can input anything in WP unit costs#22145HDinger wants to merge 1 commit intorelease/17.2from
Conversation
ea9aaa9 to
821f52e
Compare
821f52e to
aa042c9
Compare
cbliard
left a comment
There was a problem hiding this comment.
It works but I don't find the message pretty:
And as the "Costs" amount is automatically updated each time the number of unit is changed, would it be possible to run the validation on every keystroke as well? (instead of having to click "Save" button to see it's wrong)
Also there is a regression: before it was possible to enter an amount with spaces in it (like "10 000"), but it does not work anymore. What feels wrong is that the calculated cost updates itself correctly, but it can't be saved:
Also as my language is set to English, , is interpreted as the thousand separator, and . as the decimal separator.
And when I switch to French (and probably other languages), it's reversed: . is the thousand separator and , is the decimal separator.
That contradicts a bit our hour input in time tracking where both , and . are always decimal separators.
Is it ok? (I suppose as it's already how it was behaving before. We probably already have a existing bug if that's a problem for users).
So there are 2 things to change, and 2 optional:
- bad formatting of input validation message
- could it validate the field each time it changes?
- it should allow spaces in the number'
- is it ok that
.and,are treated differently depending on locale?
- is it ok that
Ticket
https://community.openproject.org/wp/72685
What are you trying to accomplish?
Allow only numbers for logged units. This needed to be done with a regex because number fields are per definition not sensitive to locales resulting in wrong results with other locales then English.