Fix SIP2 "unavailable holds" check
authorThomas Berezansky <tsbere@mvlc.org>
Mon, 30 Jan 2012 13:52:37 +0000 (08:52 -0500)
committerBill Erickson <berick@esilibrary.com>
Mon, 30 Jan 2012 18:17:13 +0000 (13:17 -0500)
If no IDs, don't look up an empty array of IDs.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm

index 519382f..832c827 100644 (file)
@@ -639,13 +639,14 @@ sub unavail_holds {
         }
     });
  
-     my @holds_sip_output = map {
+     my @holds_sip_output;
+     @holds_sip_output = map {
         OpenILS::SIP::clean_text($self->__hold_to_title($_))
      } @{
         $self->{editor}->search_action_hold_request(
             {id => [map {$_->{id}} @$ids]}
         )
-     };
+     } if (@$ids > 0);
  
      return (defined $start and defined $end) ?
          [ @holds_sip_output[($start-1)..($end-1)] ] :