-
-
Notifications
You must be signed in to change notification settings - Fork 612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proper input validation on non-string fields #1164
Comments
i am so sorry 🙈 i had the same problem recently when leaving the field empty and thought i added proper validation. In general the whole frontend error collection system needs to be improved with a quick and easy way to open a GH issue to report stuff like this. filing this as a bug to get it high up on my todo. |
Thank you! We really love Tandoor and have been porting our numerous cookbooks into it, but one of the cookbooks uses "x to y" serving sizes instead of a static number so it threw us for a loop. We both appreciate all the work you're doing! |
same here, i tried to add "250 mL" to servings and I was wondering what was causing the issue! Good thing it's already on the radar. If I can somewhat hijack the thread, there's also a generic error returned to the user when the ingredient note is too long. Input validation on this field would also be beneficial. |
yes the frontend errors need some revisiting. We had to many systems for that in the past but now all pages are migrated to the same API system and same frontend system so i can write a generic error handling system that displays a more useful message or at least some logs that i can use to analyze the problem |
ok so added input validation to the fields to only allow numbers and notes to limit to 256 characters, also added some script to verify if entered value is a number so even if something goes wrong this should not happen again. |
sorry to bump this up, but on v1.0.4 in the "Servings" field, it's still possible to input dots (.) and still getting the "There was an error updating a resource!" error. I wanted to add the 1.5 value but got the error. Maybe add some input validation regarding dots also? |
For the decimal in servings there is still an issue @1282 |
Is your feature request related to a problem? Please describe.
Yes, my wife and I just wasted 2 hours trying to figure out why our recipe was giving us a 400 when saving it. It turns out that there's not really any input validation on the "Servings" field, us using "6 to 12" caused 400s that showed almost nothing, even in debug mode.
Describe the solution you'd like
A box that gives a reason why saving the recipe is failing, at least if the answer is something as simple as input errors.
Describe alternatives you've considered
A simpler solution may be a tooltip that specifies the types of data permitted in any given field. "Servings" would specify that it must be an integer, for example.
Additional context
The error logs with debug mode on are painfully sparse, this is the entirety of what I had to work with, sanitizing my server URL:
Edit: I just wanted to say that we love the software, I realized after submitting that this sounded very harsh and that wasn't the intent!
The text was updated successfully, but these errors were encountered: