From 9be1f5e4e48cd9e9d0e670988b640a409aa76c3f Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Fri, 6 Jan 2012 18:02:06 -0800 Subject: [PATCH] Fix shelf_expire_time closed date overlap test One-liner courtesy of berick. * Steps to test This is time and timezone sensitive, so on the server: Change your timezone to America/Los Angeles: sudo dpkg-reconfigure tzdata Stop your NTP server: sudo /etc/init.d/ntp stop Set the time to 5pm: sudo date --set 17:00:00 Stop Evergreen, Restart Postgres, Start Evergreen On the client: Make sure the timezone is set to Pacific time. 1) Change the Library Setting "Default hold shelf expire interval" in the Holds group to have a value of "7 days" (without the quotes) for org BR1 (or if there is an existing value, you can keep it). 2) Create a bib with one item: htest1 (Status of Available) 3) Place a title level hold on the bib 4) Check in htest1 (it should get captured for the hold) 5) Browse the Hold Shelf and note the Shelf Expire Time for the hold that captured htest1 (it should be a week from now, unless you already have a conflicting closed date configured) 6) Cancel the hold and re-check-in htest1 (to remove the Hold Shelf status) 7) In the Closed Dates Editor, Add Single Day Closing for the date noticed previously in the Shelf Expire Time for BR1. 8) Place a title level hold on the bib 9) Check in htest1 (it should get captured for the hold) 10) Browse the Hold Shelf and note the Shelf Expire Time for the hold that captured htest1 (now the bug is illustrated if you get the same date for Shelf Expire Time as you did before, since that day is now a Closed Date and should be skipped over. The patch should fix this.) Signed-off-by: Jason Etheridge Signed-off-by: Mike Rylander --- Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm index 38f269fe95..49558b81ba 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -1019,7 +1019,7 @@ sub set_hold_shelf_expire_time { # closed date, push it out to the first open date my $dateinfo = $U->storagereq( 'open-ils.storage.actor.org_unit.closed_date.overlap', - $hold->pickup_lib, $expire_time); + $hold->pickup_lib, $expire_time->strftime('%FT%T%z')); if($dateinfo) { my $dt_parser = DateTime::Format::ISO8601->new; -- 2.43.2