internetarchive / openlibrary

One webpage for every book ever published!
https://openlibrary.org
GNU Affero General Public License v3.0
5.11k stars 1.33k forks source link

Add validation to checks to book editing fields #7899

Open GustavoHenriqueRS opened 1 year ago

GustavoHenriqueRS commented 1 year ago

Describe the problem that you'd like solved

In the book editing screen, it is possible to place invalid values, below I will place the fields tested with real values, in the title and subtitle fields it is possible to place no value, in the date field it is possible to place a string instead of a date, in the In the book weight field, it is possible to enter unrealistic values such as: 100,000kg. In the fields of the dimensions of the book, it is also possible to put values that are absurdly large and unrealistic.

Proposal & Constraints

To solve the problems mentioned is very simple, just putting some checks in the fields will solve the problem. In all fields it is necessary to place character limits and also to type the information passed, in the date field only numbers must be placed, and in the weight and size fields valid sizes must be placed, limiting the values.

Stakeholders

@gojomo @EdwardBetts @anandology @nileshtrivedi

mekarpeles commented 1 year ago

I have to ask, we've noticed an influx of validation issues coming from Brasil -- is this associated with a hackathon / university project or something similar? That may help us triage and work better with the community (unless all of these are coincidentally unrelated)! Thank you for opening this issue!

7889 #7901

GustavoHenriqueRS commented 1 year ago

Yes, its a university project.I'm studying software engineering in Brazil and I'm currently taking the software testing course.

seabelis commented 1 year ago

The date should remain a string.