From 6a685035c72463e0107cf8d361cb01f793c05f81 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Tue, 21 Jan 2014 12:31:13 -0500 Subject: [PATCH] Use copy owning library as the context for finding best hold sort order setting In the olden days before best hold sort order and proximity adjustment, there was no need to consider any context org other than "here", because the choices were, essentially, FIFO or Traditional applied within the hard-boundary range. However, now we need to decided whose rule to follow, and the most correct arbiter of that is the owning library of the call number of the copy. We avoid copy circ lib because that can change with floating copies. Signed-off-by: Mike Rylander Signed-off-by: Ben Shum --- .../lib/OpenILS/Application/Storage/Publisher/action.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 9692f27fb0..acfd24578c 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 @@ -515,8 +515,15 @@ sub nearest_hold { $cp_circ_lib = $cp->circ_lib; } + my $cp_owning_lib; + if (ref $cp->call_number->owning_lib) { + $cp_owning_lib = $cp->call_number->owning_lib->id; + } else { + $cp_owning_lib = $cp->call_number->owning_lib; + } + my ($holdsort, $addl_cte, $addl_join) = - build_hold_sort_clause(get_hold_sort_order($here), $cp, $here); + build_hold_sort_clause(get_hold_sort_order($cp_owning_lib), $cp, $here); local $OpenILS::Application::Storage::WRITE = 1; -- 2.43.2