Bug 8972

Summary: Due Date set to 100 years ago.
Product: Koha Reporter: Jesse Maseto <jesse>
Component: CirculationAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Paul Poulain <paul.poulain>
Severity: normal    
Priority: P5 - low CC: chris, gmcharlt, jcamins, kyle.m.hall, melia, paul.poulain
Version: 3.8   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: 1912 due date
Screen Shot 2
Bug 8972 - Due Date set to 100 years ago
[Signed off] Bug 8972 - Due Date set to 100 years ago
Bug 8972 - Due Date set to 100 years ago

Description Jesse Maseto 2012-10-25 21:06:08 UTC
Created attachment 13063 [details]
1912 due date

When renewing an item for a patron. If you enter a two digit year (11/01/12) Koha defaults to 1912 and gives you an enormous fine. Koha performs correctly if you enter a four digit year (11/01/2012).
Comment 1 Jesse Maseto 2012-10-25 21:24:06 UTC
Created attachment 13064 [details]
Screen Shot 2
Comment 2 Melia Meggs 2012-11-06 23:43:49 UTC
I'm updating this bug to "critical" because every time this happens, patrons are charged for 100 years worth of fines, which is obviously a problem.
Comment 3 Chris Cormack 2012-11-06 23:46:41 UTC
I think the fix here is to remove the ability to type, ie they have to use the datepicker. Or refuse to accept 2 digit dates.

Trying to guess if the person means 1912, 2012, 2112 .. is just building technical debt. So i vote force them to enter a valid date.
Comment 4 Owen Leonard 2012-11-07 15:52:14 UTC Comment hidden (obsolete)
Comment 5 Melia Meggs 2012-11-07 22:56:10 UTC Comment hidden (obsolete)
Comment 6 Melia Meggs 2012-11-07 23:00:25 UTC
I tested this patch by following Owen's test plan.  It worked beautifully in all three cases (specify due date, renewal date, and confirm invalid date).  And I like the little slide bars for the hours and minutes.  Thanks, Owen!
Comment 7 Paul Poulain 2012-11-08 17:05:32 UTC
Created attachment 13312 [details] [review]
Bug 8972 - Due Date set to 100 years ago

In order to prevent submission of dates with ambiguous two-digit
years this patch makes date-due input fields read-only so that
users must use date/time picker.

Other minor fixes:

- Adding missing labels
- Adding common class wrapper to datepicker for checkout and renewal
- Correcting focus handling on "specify due date" field (should
  focus on barcode field after a date has been selected).
- Removing trailing comma from JavaScript (breaks IE)

To test, try typing an invalid number in any of the date due entry
fields: Under 'specify due date,' 'renewal due date,' or the
confirm "invalid" date dialog (after specifying a date in the past).
Manual entry should not work. Choosing a date/time using the
widget should work.

Signed-off-by: Melia Meggs <melia@test.bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Comment 8 Paul Poulain 2012-11-08 17:09:22 UTC
QA comments:
 * passes koha-qa.pl
 * I think, even if I couldn't check it, that there's no string change (the "Specify due date..." is not translated in french for 3.10
 * I don't think libraries will complain that the behaviour changed, but I just wanted to point that this patch introduces a small change in circulation workflow.
 * the severity is not critical, because it's a bug only when the librarian put silly data in the date. Lowering severity

Overall, not sure it should be pushed for 3.10.0 because of string freeze, but for 3.10.1 yes.

passed QA
Comment 9 Jared Camins-Esakov 2012-11-09 04:30:49 UTC
This patch has been pushed to master.
Comment 10 Chris Cormack 2012-11-11 05:53:39 UTC
Does not apply to 3.8.x, please create a rebased patch if it is needed in 3.8.x
Comment 11 Paul Poulain 2012-11-12 13:24:31 UTC
Patch pushed to branch 3.10.x
Comment 12 Chris Cormack 2013-04-22 08:42:55 UTC
Released in 3.10.0