Submission date extraction failure is not reported well (and date-guessing heuristics are delicate) #8434
Closed
1 task done
Labels
accepted
bug
Something isn't working
component: submit/
contrib-medium
Medium dev difficulty for contribution
minor
Describe the issue
If a user submits an XML draft with a missing or incomplete date, the submission tool tries to fill in a reasonable guess. The rule is roughly
There's a poorly handled corner case here: if a user provides a year but not a month / day, the date is filled in but only if the year is the current year. If it's any other year, the month and day are left as
None
. This leads to an unhandled exception that is logged as a generic "A system error occurred" type message in the submission's history.This appears to have come up for at least one and maybe a couple users following 2025-01-01. I don't have their draft source, but I'm guessing they were using "2024" as the date in their drafts.
To resolve this, we must at least raise a
SubmissionError
in the date extraction code for the case that we're unable to extract a date. If we raise this with a message that indicates that the problem was in the date element, then it will be reported to the submitter who will then have a useful nudge toward fixing their problem.We might also consider improving the heuristics to look at time intervals rather than calendar years/months for deciding whether it's reasonable to assume "today" or "this month" as the date. That's a bigger can of worms, though.
Code of Conduct
The text was updated successfully, but these errors were encountered: