From db7d53d85e8bb13c47b568683269a32a4fec9221 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 2 Feb 2017 17:00:24 -0500 Subject: [PATCH] LP#1596595 Targeter accepts a list of hold ID's Allow the caller to pass a list of hold ID's (consistent with the current hold targeter). This resolves the issue where the checkin process attempts to retarget a set of holds via a single targeter call. Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm index 125b395ac7..75b8e84b8c 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm @@ -47,8 +47,9 @@ sub new { # # Optional parameters: # -# hold => -# (Re)target a specific hold. +# hold => / [, , ...] +# (Re)target one or more specific holds. Specified as a single hold ID +# or an array ref of hold IDs. # # return_count => 1 # Return the total number of holds processed instead of a result @@ -105,7 +106,11 @@ sub target { sub find_holds_to_target { my $self = shift; - return ($self->{hold}) if $self->{hold}; + if ($self->{hold}) { + # $self->{hold} can be a single hold ID or an array ref of hold IDs + return @{$self->{hold}} if ref $self->{hold} eq 'ARRAY'; + return ($self->{hold}); + } my $query = { select => {ahr => ['id']}, -- 2.11.0