Bugzilla – Attachment 114339 Details for
Bug 27204
SIP patron information request with fee line items returns incorrect data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27204: Fix end boundary index, never return results for non-existant accountlines
Bug-27204-Fix-end-boundary-index-never-return-resu.patch (text/plain), 1.84 KB, created by
Kyle M Hall (khall)
on 2020-12-11 12:16:51 UTC
(
hide
)
Description:
Bug 27204: Fix end boundary index, never return results for non-existant accountlines
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-12-11 12:16:51 UTC
Size:
1.84 KB
patch
obsolete
>From f51e6af9abb8b04f582d3d77034161cd30b9093b Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 11 Dec 2020 07:13:12 -0500 >Subject: [PATCH] Bug 27204: Fix end boundary index, never return results for > non-existant accountlines > >There are two primary issues I've identified with requesting line items >for fees via SIP: > >1) The end boundary is incorrect. For example, if send a request with a >BP ( starting item) of 1, and a BQ (end item) of 1, I should get just >the first item. Instead I will get two items > >2) Our SIP server does not check bounds. For example, if I have 3 fines, >but I send a BP of 1 and a BQ of 5, I will get back 5 AVs, two of >them being "empty" because the patron only has 3 accountlines! > >Test Plan: >1) Apply the unit test patch >2) prove t/db_dependent/SIP/Patron.t >3) Note the failures >4) Apply the second patch >5) prove t/db_dependent/SIP/Patron.t >6) All tests should pass! >--- > C4/SIP/ILS/Patron.pm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/C4/SIP/ILS/Patron.pm b/C4/SIP/ILS/Patron.pm >index 9820013ee7..b6a75ad77f 100644 >--- a/C4/SIP/ILS/Patron.pm >+++ b/C4/SIP/ILS/Patron.pm >@@ -377,7 +377,7 @@ sub fine_items { > ); > > $start = $start ? $start - 1 : 0; >- $end = $end ? $end : scalar @fees - 1; >+ $end = $end ? $end - 1 : scalar @fees - 1; > > my $av_field_template = $server ? $server->{account}->{av_field_template} : undef; > $av_field_template ||= "[% accountline.description %] [% accountline.amountoutstanding | format('%.2f') %]"; >@@ -388,6 +388,8 @@ sub fine_items { > for ( my $i = $start; $i <= $end; $i++ ) { > my $fee = $fees[$i]; > >+ next unless $fee; >+ > my $output; > $tt->process( \$av_field_template, { accountline => $fee }, \$output ); > push( @return_values, { barcode => $output } ); >-- >2.24.1 (Apple Git-126)
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 27204
:
114338
|
114339
|
115824
|
115825
|
116119
|
116120