From a2b53495c20967330ffdc9f282685bdc3a259e93 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 1 Mar 2023 15:40:03 -0500 Subject: [PATCH] LP1744341 Hold targeter --retarget-frozen fix Perform the actual copy map updates then exit targeting the frozen hold. Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm index 317780d6e2..7c343b35e6 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm @@ -1404,7 +1404,7 @@ sub target { if $hold->capture_time || $hold->cancel_time || $hold->fulfillment_time || - $U->is_true($hold->frozen); + ($U->is_true($hold->frozen) && !$self->parent->{retarget_frozen}); $self->hold($hold); @@ -1412,8 +1412,16 @@ sub target { return unless $self->get_hold_copies; return unless $self->update_copy_maps; - # Hopeless Date logic based on copy map + # We may have updated the hold copy maps for a frozen hold in + # the presence of retarget_frozen. We don't, however, want to + # actually find a current_copy (target) or perform any other + # actions on the hold if it's frozen. + if ($U->is_true($hold->frozen)) { + $self->editor->commit; + return $self->exit_targeter("Frozen hold remapped; all done"); + } + # Hopeless Date logic based on copy map $self->handle_hopeless_date; # Confirm that we have something to work on. If we have no -- 2.11.0