From efb7d87f9a14d01a3ddf38c09be90a1f75eeebda Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 5 Apr 2013 13:28:08 -0400 Subject: [PATCH] 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 --- Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm index 5ce70e9395..55d95b4d53 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 { @@ -622,7 +622,7 @@ sub charged_items { @charges = @c; return (defined $start and defined $end) ? - [ $charges[($start-1)..($end-1)] ] : + [ @charges[($start-1)..($end-1)] ] : \@charges; } @@ -645,7 +645,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 -- 2.11.0