Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require author and translator dates are numeric
This goes some way to addressing issue LibriVox#154 -- users won't be able to enter non-numeric dates, which is unfortunate, but it does mean that they'll get a proper error message instead of the random server error that they get right now. For the more technical explanation -- When we save the form generation, that all goes into the `form_generators` table. Any new authors that are created as part of the generator are saved into `form_generators_authors`, which has the `auth_yob` and `auth_yod` columns as four-digit integers. This doesn't align well with the actual `authors` table, which allows pretty much anything (`varchar(10)`), and I have no idea how people specify AD vs. BCE using the generator. I don't know enough about how the table is used to know whether we should consider migrating it to `varchar(10)` to match `authors`, but having the two consistent with each other would be good probably. I also tried specifying the input fields as numeric in the HTML, but that didn't quite have the desired effect -- it would just submit the field as empty if it wasn't right, which meant we'd silently drop the data rather than get a validation error.
- Loading branch information