From: Bill Erickson Date: Fri, 5 Apr 2013 17:28:08 +0000 (-0400) Subject: Repair SIP start/end list ranges X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=418bbfa33aecb0bdbc118d2162ae6b7e3c2b8d8b;p=evergreen%2Fpines.git Repair SIP start/end list ranges SIP supports paging of certain lists (holds, fines, etc.) by allowing the SIP client to provide start and end points for lists. This patch repairs how Evgreen extracts the list ranges from arrays. When using Perl array ranges, the array variable should be accessed via '@' and not '$'. Prior to this change, all ranged lists resulted in returning the first item in the list instead of the full range. This change affects lists of holds, overdues, fines, and charges. Signed-off-by: Bill Erickson Signed-off-by: Jeff Godin --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm index d40be97f0d..a3b0f85aaa 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm @@ -467,7 +467,7 @@ sub hold_items { push( @holds, OpenILS::SIP::clean_text($self->__hold_to_title($_)) ) for @$holds; return (defined $start and defined $end) ? - [ $holds[($start-1)..($end-1)] ] : + [ @holds[($start-1)..($end-1)] ] : \@holds; } @@ -574,7 +574,7 @@ sub overdue_items { @overdues = @o; return (defined $start and defined $end) ? - [ $overdues[($start-1)..($end-1)] ] : \@overdues; + [ @overdues[($start-1)..($end-1)] ] : \@overdues; } sub __circ_to_barcode { @@ -623,7 +623,7 @@ sub charged_items { @charges = @c; return (defined $start and defined $end) ? - [ $charges[($start-1)..($end-1)] ] : + [ @charges[($start-1)..($end-1)] ] : \@charges; } @@ -646,7 +646,7 @@ sub fine_items { my $log_status = $@ ? 'ERROR: ' . $@ : 'OK'; syslog('LOG_DEBUG', 'OILS: Patron->fine_items() ' . $log_status); return (defined $start and defined $end) ? - [ $fines[($start-1)..($end-1)] ] : \@fines; + [ @fines[($start-1)..($end-1)] ] : \@fines; } # not currently supported