-
Notifications
You must be signed in to change notification settings - Fork 18
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
Some characters now not allowed in author date fields #154
Comments
We also had a possible rejection of a period in an author name field. So:
|
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.
I believe it worked before the upgrade because the new version of the database software is more strict in what input it accepts (https://mariadb.com/kb/en/sql-mode/#strict_trans_tables). So previously, if a field in the database was listed as an integer, but if the input was some alphanumeric string of characters, there would be some magic at the database level that would accept the input, possibly mangling it somewhat, or dropping that particular field altogether while still updating the other ones in the query (I'm not very knowledgeable about this, hence the handwavy "magic" explanation). @garethsime's PR #169 is one way to address this, but it would mean author YOB and YOD would only be numbers. That would make sense to me, but I'm not sure if there's precedent for inputing other kinds of data into those fields. |
Yeah, my PR definitely doesn't solve the underlying problem, it just gives a better error message. (There were a couple of threads in the forum where people were expressing frustration that they were just getting a generic error message with no information on how to fix it.) |
There's definitely precedent for non-numeric characters in YOB and YOD fields: ca., BC or BCE, AD or CE, and fl. being the primary ones.
On Saturday, September 9, 2023 at 05:29:46 p.m. EDT, Gareth Sime ***@***.***> wrote:
Yeah, my PR definitely doesn't solve the underlying problem, it just gives a better error message. (There were a couple of threads in the forum where people were expressing frustration that they were just getting a generic error message with no information on how to fix it.)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
From PR #169:
From @twinkietoes-on above:
So that sounds like the solution is to make |
It looks like this has been fixed, at least it has the new column definitions in my copy of the database from a couple months ago (and it seems to work locally!) |
Trying to use a dash in the author date field (such as "ca. 1315-1325") or a slash (such as "1315/1325") results in the field not saving. Those are the only two characters discovered that are occasionally used.
This has only been an issue since the upgrades. It worked before.
The text was updated successfully, but these errors were encountered: