From 52774ce7de4720c41444665215cb15d53dd111f5 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Tue, 20 Jul 2021 11:21:05 -0400 Subject: [PATCH] We need to get the in-use copy proximity separately, as they are already filtered out and undef == 0 in a Perl numeric comparison Signed-off-by: Mike Rylander --- Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm index 6180ae7264..64f19706f7 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm @@ -761,6 +761,14 @@ sub compile_weighted_proximity_map { push(@{$prox_map{$prox}}, $copy_hash) foreach (1 .. $weight); } + # We need to grab the proximity for copies targeted by other holds + # that belong to this pickup lib for hard-stalling tests later. We'll + # just grab them all in case it's useful later. + for my $copy_hash (@{$self->in_use_copies}) { + my $prox = $copy_prox_map{$copy_hash->{id}}; + $copy_hash->{proximity} = $prox; + } + return $self->{weighted_prox_map} = \%prox_map; } -- 2.11.0