From: Jason Stephenson Date: Thu, 2 May 2019 12:36:15 +0000 (-0400) Subject: LP 1827250: Fix Last Captured Hold Check for Holds Shelf X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=83e278e8a4298ddc54d1c15ccd84b55b188717fe;p=Evergreen.git LP 1827250: Fix Last Captured Hold Check for Holds Shelf When the current copy on an on shelf hold is the same as that on some uncaptured holds, the hold fails to appear on the hold shelf when it should. This comes down to some SQL in the storage function to retrieve wide holds: open-ils.storage.action.live_holds.wide_hash. The intent of the new code is to check that the current hold matches the most recently captured hold for the copy. However, the order by in the query fails to take into account holds with a NULL capture time on the same copy will sort before the captured holds. This patch rectifies this situation by adding "NULLS LAST" to the order by. Signed-off-by: Jason Stephenson Signed-off-by: Michele Morgan Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm index f987d3b973..213ed59e5a 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm @@ -2146,7 +2146,7 @@ sub wide_hold_data { SELECT id FROM action.hold_request recheck WHERE recheck.current_copy = cp.id - ORDER BY capture_time DESC + ORDER BY capture_time DESC NULLS LAST LIMIT 1 ))) SQL