Web Client: Can Check Out with Due Date in the Past

Bug #1712644 reported by Terran McCanna
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
3.0
Won't Fix
Medium
Unassigned
3.1
Won't Fix
Medium
Unassigned
3.2
Won't Fix
Medium
Unassigned
3.3
Fix Released
Medium
Unassigned

Bug Description

In the 2.12.4 web client:

When checking out with the "specific due date" option, the interface does not prevent you from selecting a date in the past or at least giving a warning.

(In the xul client, the box around it turned red and would not let you complete the checkout.)

Kathy Lussier (klussier)
Changed in evergreen:
status: New → Confirmed
Andrea Neiman (aneiman)
Changed in evergreen:
importance: Undecided → Medium
milestone: none → 3.0-beta2
Changed in evergreen:
milestone: 3.0-beta2 → 3.0-rc
Galen Charlton (gmc)
Changed in evergreen:
milestone: 3.0-rc → 3.0.1
Changed in evergreen:
milestone: 3.0.1 → 3.0.2
Changed in evergreen:
milestone: 3.0.2 → 3.0.3
Changed in evergreen:
milestone: 3.0.3 → 3.0.4
Changed in evergreen:
milestone: 3.0.4 → 3.0.5
Changed in evergreen:
milestone: 3.0.5 → 3.0.6
Changed in evergreen:
milestone: 3.0.6 → 3.0.7
Changed in evergreen:
milestone: 3.0.7 → 3.0.8
Changed in evergreen:
milestone: 3.0.8 → 3.1.3
Revision history for this message
Nathan Eady (mrmcquack) wrote :

The ability to do this is actually useful for testing.

Changed in evergreen:
milestone: 3.1.3 → 3.1.4
Changed in evergreen:
milestone: 3.1.4 → 3.1.5
Changed in evergreen:
milestone: 3.1.5 → 3.1.6
Changed in evergreen:
milestone: 3.1.6 → 3.2.1
Kyle Huckins (khuckins)
Changed in evergreen:
assignee: nobody → Kyle Huckins (khuckins)
Changed in evergreen:
milestone: 3.2.1 → 3.2.2
Revision history for this message
Evergreen Bug Maintenance (bugmaster) wrote :

Removing milestones for lack of pull request.

Changed in evergreen:
milestone: 3.2.2 → none
Revision history for this message
Katlyn Beck (klbeck) wrote :

I've resolved this issue with the following branch:
http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/klbeck/lp1712644-check-out-due-date

When trying to check out using a date in the past, the checkout input is disabled and an error will appear below the date-picker.

Changed in evergreen:
assignee: Kyle Huckins (khuckins) → Katlyn Beck (klbeck)
assignee: Katlyn Beck (klbeck) → nobody
tags: added: pullrequest
Katlyn Beck (klbeck)
Changed in evergreen:
assignee: nobody → Katlyn Beck (klbeck)
Revision history for this message
Katlyn Beck (klbeck) wrote :

I've fixed a minor thinko and amended my previous commit with a fix.
Now, when the date picker is open, past dates cannot be selected. When a past date is manually typed into the due date input box, the checkout input is disabled and an error will appear below the date-picker.

Changed in evergreen:
assignee: Katlyn Beck (klbeck) → nobody
Revision history for this message
Terran McCanna (tmccanna) wrote :

Tested on 3.2.1 and it works well for us!

I have tested this code and consent to signing off on it with my name, Terran McCanna, and my email address, <email address hidden>.

tags: added: signedoff
Revision history for this message
Terran McCanna (tmccanna) wrote :

Removing signoff because it causes an "input out of range" error on the patron registration / edit screen. (It doesn't stop it from saving on that screen, but shows an error.)

tags: removed: signedoff
Michele Morgan (mmorgan)
tags: added: needsrepatch
Revision history for this message
Kyle Huckins (khuckins) wrote :

The branch had the right general idea, but some things needed to be moved around a bit. I've made some changes and also added a year check to the outOfRange check(previously there was only a month and a day) and pushed up a branch here: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/collab/khuckins/lp1712644-check-out-due-date

Changed in evergreen:
assignee: nobody → Kyle Huckins (khuckins)
assignee: Kyle Huckins (khuckins) → nobody
tags: removed: needsrepatch
Revision history for this message
Dawn Dale (ddale) wrote :

I was unable to test this fix on the bugsquash server.

Revision history for this message
Dawn Dale (ddale) wrote :

Sorry, last comment was posted to the wrong bug.

I have tested this code and consent to signing off on it with my name, Dawn Dale and my email address, <email address hidden>

Dawn Dale (ddale)
tags: added: signedoff
Revision history for this message
Bill Erickson (berick) wrote :

Thanks, All. Regarding the implementation, I'm curious about the added year/month/date checks. Is the getTime() check not sufficient?

Revision history for this message
Kyle Huckins (khuckins) wrote :

We ran into an edge case where if you manually input a previous month or year without the additional checks, it would still allow you to submit. I originally assumed getTime would have done the trick as well, and I'm still not 100% sure why it didn't

Revision history for this message
Kyle Huckins (khuckins) wrote :

On further testing without the additional checks in egDatePicker, it seems to be working just fine only using getTime(). I've squashed both Katlyn's and I's on my collab branch, as all changes to the ui.js have been reverted by my commit.

Revision history for this message
Galen Charlton (gmc) wrote :

Upon testing, this needs a little more bullet-proofing:

[1] Go to the checkout page.
[2] Turn on the "Use Specific Date Until Logout" option.
[3] Type in a value that is out of range. The widget will indicate that and the barcode input will be disabled.

But...

[4] Switch to the Items Out tab, then back to the Checkout tab.
[5] The invalid date set in step #3 will be in effect, and you will be allowed to check out an item with the bogus date.

tags: added: needsrepatch
removed: pullrequest signedoff
Kyle Huckins (khuckins)
Changed in evergreen:
assignee: nobody → Kyle Huckins (khuckins)
Revision history for this message
Kyle Huckins (khuckins) wrote :

Thanks Galen,

I've rebased the branch to master, and have been unable to replicate that issue - it looks like the Date Options aren't persisting when switching to Items Out and back, resetting the date selected in the datepicker and removing the outOfRange value.

Changed in evergreen:
assignee: Kyle Huckins (khuckins) → nobody
Revision history for this message
Kyle Huckins (khuckins) wrote :

*Doh* Spoke too soon, I wasn't using the "Until logout" option. Investigating a fix...

Changed in evergreen:
assignee: nobody → Kyle Huckins (khuckins)
Revision history for this message
Kyle Huckins (khuckins) wrote :

The branch has been rebased to latest master, and changes have been made to ensure the page is watching changes to the date input even when the input is seen as identical to what it was previously.

I've also ensured that incomplete date inputs(Think: 2019-0-01) won't break the UI by being saved to hatch.

Changed in evergreen:
assignee: Kyle Huckins (khuckins) → nobody
tags: added: pullrequest
removed: needsrepatch
Michele Morgan (mmorgan)
Changed in evergreen:
milestone: none → 3.3.4
Changed in evergreen:
milestone: 3.3.4 → 3.3.5
Changed in evergreen:
milestone: 3.3.5 → 3.4.2
Revision history for this message
Terran McCanna (tmccanna) wrote :
tags: added: signedoff
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed to master, rel_3_4, and rel_3_3. Thanks, Katlyn, Kyle, and Terran!

Changed in evergreen:
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.