Bugzilla – Attachment 91992 Details for
Bug 23426
Empty AV field returned in 'patron info' in addition to those requested
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch correcting extraction of items
0001-Bug-23426-Return-correct-number-of-Fine-Items.patch (text/plain), 2.08 KB, created by
Colin Campbell
on 2019-08-05 13:22:23 UTC
(
hide
)
Description:
Patch correcting extraction of items
Filename:
MIME Type:
Creator:
Colin Campbell
Created:
2019-08-05 13:22:23 UTC
Size:
2.08 KB
patch
obsolete
>From fdac11b1e88f66b63add2610e25831445c601637 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Mon, 5 Aug 2019 13:59:28 +0100 >Subject: [PATCH] Bug 23426 Return correct number of Fine Items > >When subsets of Fine Items are requested in a Patron Info response >the server was returning an extra field. > >The Request specifys the items requested as a closed array >based on 1. e.g. to get a single item start and end are both set to 1 >The code sets start to start - 1 but left stop unchanged and looped as >though in a closed array rather than a half-open one with the result >that an extra field is returned. Often this is empty as it tries to read >past the end of the main array. This patch cleans up the logic to >behave correctly > >Removed the superfluous brackets around push's arguments to make >consistent with other uses in the module >--- > C4/SIP/ILS/Patron.pm | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >diff --git a/C4/SIP/ILS/Patron.pm b/C4/SIP/ILS/Patron.pm >index 30c0e48ac6..061a6395f4 100644 >--- a/C4/SIP/ILS/Patron.pm >+++ b/C4/SIP/ILS/Patron.pm >@@ -352,8 +352,10 @@ sub fine_items { > } > ); > >+ # start and end are specified as a 1-based indices >+ # convert them to standard half open array start and terminate values > $start = $start ? $start - 1 : 0; >- $end = $end ? $end : scalar @fees - 1; >+ $end = $end ? $end : scalar @fees; > > my $av_field_template = $server ? $server->{account}->{av_field_template} : undef; > $av_field_template ||= "[% accountline.description %] [% accountline.amountoutstanding | format('%.2f') %]"; >@@ -361,12 +363,12 @@ sub fine_items { > my $tt = Template->new(); > > my @return_values; >- for ( my $i = $start; $i <= $end; $i++ ) { >+ for ( my $i = $start; $i < $end; $i++ ) { > my $fee = $fees[$i]; > > my $output; > $tt->process( \$av_field_template, { accountline => $fee }, \$output ); >- push( @return_values, { barcode => $output } ); >+ push @return_values, { barcode => $output }; > } > > return \@return_values; >-- >2.21.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23426
:
91992
|
165507
|
165508
|
165509
|
165654
|
166240
|
169272
|
170931
|
172383
|
172384
|
174232
|
174233
|
174234
|
174464
|
174465
|
174479