You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks @HeLinChooi - I agree negative numbers shouldn't be allowed in this quick form (or in other quick forms for that matter).
However, I think zero should be allowed. Someone may use that as a placeholder for a log that hasn't happened yet, and that they plan to fill in with an actual value later.
Would you like to start a pull request for adding validation to prevent negative numbers? It should be fairly simple. I think we just need to change the input form element from '#type' => 'textfield' to '#type' => 'number' add '#min' => 0, so that it can't be negative.
Quantity value field in the quantity entity form (displayed for example in the log entity form) uses fraction_decimal input element type that adds some additional validation that the given value is a valid fraction. Maybe it would be a good idea to also use it in the quick forms. Although it would complicate adding validation that value is not negative since fraction_decimal type doesn't currently support setting the #min value.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The system displays error message “The count value can’t be zero or negative”.
Screenshots
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: