From c69b6db04fd2f3f22f93260a003323fcb2ec74e2 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 3 Jun 2009 15:22:29 +0000 Subject: [PATCH] when retargeting alternate holds after opportunistic checkin capture, only retarget related holds not all holds with prev_check_time=null git-svn-id: svn://svn.open-ils.org/ILS/trunk@13298 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm | 5 +++-- Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm index 8c8fd415b..e91779300 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm @@ -1999,9 +1999,10 @@ sub do_hold_notify { } sub retarget_holds { - $logger->info("circulator: retargeting prev_check_time=null holds after opportunistic capture"); + my $self = shift; + $logger->info("circulator: retargeting holds @{$self->retarget} after opportunistic capture"); my $ses = OpenSRF::AppSession->create('open-ils.storage'); - $ses->request('open-ils.storage.action.hold_request.copy_targeter'); + $ses->request('open-ils.storage.action.hold_request.copy_targeter', undef, $self->retarget); # no reason to wait for the return value return; } diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm index ed498aada..ed3d9cdb0 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm @@ -1642,7 +1642,7 @@ sub find_nearest_permitted_hold { or return (undef, $editor->event); - my $retarget = 0; + my @retarget; # re-target any other holds that already target this copy for my $old_hold (@$old_holds) { @@ -1653,10 +1653,10 @@ sub find_nearest_permitted_hold { $old_hold->clear_prev_check_time; $editor->update_action_hold_request($old_hold) or return (undef, $editor->event); - $retarget = 1; + push(@retarget, $old_hold->id); } - return ($best_hold, undef, $retarget); + return ($best_hold, undef, (@retarget) ? \@retarget : undef); } -- 2.11.0