Bug 25789 - New expiration date on placing a hold in staff interface can be set to a date in the past
Summary: New expiration date on placing a hold in staff interface can be set to a date...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Emmi Takkinen
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 26429 28124
  Show dependency treegraph
 
Reported: 2020-06-17 19:15 UTC by George Williams (NEKLS)
Modified: 2021-12-13 21:11 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.02, 19.11.08


Attachments
Bug 25789: Don't allow past date as holds expiration date (1.47 KB, patch)
2020-06-18 07:04 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 25789: Don't allow past date as holds expiration date (1.52 KB, patch)
2020-06-18 12:27 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 25789: Don't allow past date as holds expiration date (1.58 KB, patch)
2020-06-21 16:05 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description George Williams (NEKLS) 2020-06-17 19:15:24 UTC
When creating a new request on request.pl, staff cannot set a hold expires on date in the past -- input name="expiration_date".

When editing an existing request, however, the new datepicker for editing the expiration date on request.pl does allow for a date to be set in the past -- input name="expirationdate".
Comment 1 Emmi Takkinen 2020-06-18 07:04:41 UTC
Created attachment 105996 [details] [review]
Bug 25789: Don't allow past date as holds expiration date

When editing existing holds expiration date it's possible to select
past date from datepicker. This patch changes expiration inputs class
as "datepickerto" to make past dates unselectable.

To test:
1.  Find item with holds
2.  Edit holds expiration date
=> Note that past dates are selectable
3. Apply patch
4. Edit again
=> Past dates are no longer selectable

Sponsored-by: Koha-Suomi Oy
Comment 2 Emmi Takkinen 2020-06-18 07:10:33 UTC
Also valid in master and patch provided is made against it. Changed version of this bug as 'master'.
Comment 3 Owen Leonard 2020-06-18 12:27:19 UTC
Created attachment 106005 [details] [review]
Bug 25789: Don't allow past date as holds expiration date

When editing existing holds expiration date it's possible to select
past date from datepicker. This patch changes expiration inputs class
as "datepickerto" to make past dates unselectable.

To test:
1.  Find item with holds
2.  Edit holds expiration date
=> Note that past dates are selectable
3. Apply patch
4. Edit again
=> Past dates are no longer selectable

Sponsored-by: Koha-Suomi Oy

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 4 Katrin Fischer 2020-06-21 16:05:41 UTC
Created attachment 106131 [details] [review]
Bug 25789: Don't allow past date as holds expiration date

When editing existing holds expiration date it's possible to select
past date from datepicker. This patch changes expiration inputs class
as "datepickerto" to make past dates unselectable.

To test:
1.  Find item with holds
2.  Edit holds expiration date
=> Note that past dates are selectable
3. Apply patch
4. Edit again
=> Past dates are no longer selectable

Sponsored-by: Koha-Suomi Oy

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Jonathan Druart 2020-06-24 13:33:20 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 6 Lucas Gass 2020-07-10 16:29:50 UTC
backported to 20.05.x for 20.05.02
Comment 7 Aleisha Amohia 2020-07-13 02:35:56 UTC
backported to 19.11.x for 19.11.08
Comment 8 Victor Grousset/tuxayo 2020-07-24 00:09:18 UTC
Can't backport to 19.05.x, the code doesn't seems to have that part here (a datepicker). Maybe the feature wasn't here, maybe it moved from another file
If interested, feel free to investigate further.
Comment 9 Caroline Cyr La Rose 2020-08-21 14:02:00 UTC
For the sake of the release notes, I'm classifying this as a bug rather than an enhancement. 

Feel free to change it back if you think this is wrong.