From: Bill Erickson Date: Thu, 2 Feb 2017 22:00:24 +0000 (-0500) Subject: LP#1596595 Targeter accepts a list of hold ID's X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=db7d53d85e8bb13c47b568683269a32a4fec9221;p=evergreen%2Fpines.git 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 --- 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']},