Bugzilla – Attachment 41602 Details for
Bug 14498
uri_escape error triggered by duplicate accountno's for patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14498 - uri_escape error triggered by duplicate accountno's for patron
Bug-14498---uriescape-error-triggered-by-duplicate.patch (text/plain), 6.85 KB, created by
Jonathan Druart
on 2015-08-18 14:28:29 UTC
(
hide
)
Description:
Bug 14498 - uri_escape error triggered by duplicate accountno's for patron
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-08-18 14:28:29 UTC
Size:
6.85 KB
patch
obsolete
>From 53db83d7f3d92b3b7cd0968487db57470b9b9b3e Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 6 Jul 2015 11:00:38 -0400 >Subject: [PATCH] Bug 14498 - uri_escape error triggered by duplicate > accountno's for patron > >If a patron has duplicate accountno's for two different fines in Koha this will trigger the error >usi_escape: Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE ])/ at (eval 133) line 1. >upon attempt to pay. How those accountno's get duplicated is unknown, but considering accountno >is somewhat vestigial at this point in time, it would be much more sensible to use accountlines_id >which is has guaranteed uniqueness at the database level. > >Test Plan: >1) Create a patron with 2 fines >2) Edit the accountno's for those fines and set them to 0 >3) Attempt to pay one, note the error >4) Apply this patch >5) Refesh the page >6) Attempt to pay one, no error this time! >7) Test Pay, Write off, Pay amount, Write off all, and Pay selected > >Signed-off-by: Deborah Duce <deborah.duce@huntsvillelibrary.ca> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../intranet-tmpl/prog/en/modules/members/pay.tt | 29 +++++++++++----------- > members/pay.pl | 6 ++--- > 2 files changed, 16 insertions(+), 19 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >index 18b857c..64a0f68 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >@@ -94,25 +94,24 @@ function enableCheckboxActions(){ > <tr> > <td> > [% IF ( line.amountoutstanding > 0 ) %] >- <input class="cb" type="checkbox" checked="checked" name="incl_par_[% line.accountno %]" /> >+ <input class="cb" type="checkbox" checked="checked" name="incl_par_[% line.accountlines_id %]" /> > [% END %] > </td> > <td> > [% IF ( line.amountoutstanding > 0 ) %] >- <input type="submit" name="pay_indiv_[% line.accountno %]" value="Pay" /> >- [% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="wo_indiv_[% line.accountno %]" value="Write off" />[% END %] >+ <input type="submit" name="pay_indiv_[% line.accountlines_id %]" value="Pay" /> >+ [% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="wo_indiv_[% line.accountlines_id %]" value="Write off" />[% END %] > [% END %] >- <input type="hidden" name="itemnumber[% line.accountno %]" value="[% line.itemnumber %]" /> >- <input type="hidden" name="description[% line.accountno %]" value="[% line.description %]" /> >- <input type="hidden" name="accounttype[% line.accountno %]" value="[% line.accounttype %]" /> >- <input type="hidden" name="amount[% line.accountno %]" value="[% line.amount %]" /> >- <input type="hidden" name="accountlines_id[% line.accountno %]" value="[% line.accountlines_id %]" /> >- <input type="hidden" name="amountoutstanding[% line.accountno %]" value="[% line.amountoutstanding %]" /> >- <input type="hidden" name="borrowernumber[% line.accountno %]" value="[% line.borrowernumber %]" /> >- <input type="hidden" name="accountno[% line.accountno %]" value="[% line.accountno %]" /> >- <input type="hidden" name="notify_id[% line.accountno %]" value="[% line.notify_id %]" /> >- <input type="hidden" name="notify_level[% line.accountno %]" value="[% line.notify_level %]" /> >- <input type="hidden" name="totals[% line.accountno %]" value="[% line.totals %]" /> >+ <input type="hidden" name="itemnumber[% line.accountlines_id %]" value="[% line.itemnumber %]" /> >+ <input type="hidden" name="description[% line.accountlines_id %]" value="[% line.description %]" /> >+ <input type="hidden" name="accounttype[% line.accountlines_id %]" value="[% line.accounttype %]" /> >+ <input type="hidden" name="amount[% line.accountlines_id %]" value="[% line.amount %]" /> >+ <input type="hidden" name="accountlines_id[% line.accountlines_id %]" value="[% line.accountlines_id %]" /> >+ <input type="hidden" name="amountoutstanding[% line.accountlines_id %]" value="[% line.amountoutstanding %]" /> >+ <input type="hidden" name="borrowernumber[% line.accountlines_id %]" value="[% line.borrowernumber %]" /> >+ <input type="hidden" name="notify_id[% line.accountlines_id %]" value="[% line.notify_id %]" /> >+ <input type="hidden" name="notify_level[% line.accountlines_id %]" value="[% line.notify_level %]" /> >+ <input type="hidden" name="totals[% line.accountlines_id %]" value="[% line.totals %]" /> > </td> > <td> > [% SWITCH line.accounttype %] >@@ -139,7 +138,7 @@ function enableCheckboxActions(){ > [%- IF line.description %], [% line.description %][% END %] > [% IF line.title %]([% line.title %])[% END %] > </td> >- <td><input type="text" name="payment_note_[% line.accountno %]" /></td> >+ <td><input type="text" name="payment_note_[% line.accountlines_id %]" /></td> > <td>[% line.accounttype %]</td> > <td>[% line.notify_id %]</td> > <td>[% line.notify_level %]</td> >diff --git a/members/pay.pl b/members/pay.pl >index 07217fd..a4f73f2 100755 >--- a/members/pay.pl >+++ b/members/pay.pl >@@ -170,7 +170,6 @@ sub redirect_to_paycollect { > $redirect .= get_for_redirect( 'amount', "amount$line_no", 1 ); > $redirect .= > get_for_redirect( 'amountoutstanding', "amountoutstanding$line_no", 1 ); >- $redirect .= get_for_redirect( 'accountno', "accountno$line_no", 0 ); > $redirect .= get_for_redirect( 'title', "title$line_no", 0 ); > $redirect .= get_for_redirect( 'itemnumber', "itemnumber$line_no", 0 ); > $redirect .= get_for_redirect( 'notify_id', "notify_id$line_no", 0 ); >@@ -184,7 +183,7 @@ sub redirect_to_paycollect { > > sub writeoff_all { > my @params = @_; >- my @wo_lines = grep { /^accountno\d+$/ } @params; >+ my @wo_lines = grep { /^accountlines_id\d+$/ } @params; > for (@wo_lines) { > if (/(\d+)/) { > my $value = $1; >@@ -193,7 +192,6 @@ sub writeoff_all { > # my $borrowernum = $input->param("borrowernumber$value"); > my $itemno = $input->param("itemnumber$value"); > my $amount = $input->param("amountoutstanding$value"); >- my $accountno = $input->param("accountno$value"); > my $accountlines_id = $input->param("accountlines_id$value"); > my $payment_note = $input->param("payment_note_$value"); > WriteOffFee( $borrowernumber, $accountlines_id, $itemno, $accounttype, $amount, $branch, $payment_note ); >@@ -250,7 +248,7 @@ sub payselected { > foreach (@params) { > if (/^incl_par_(\d+)$/) { > my $index = $1; >- push @lines_to_pay, $input->param("accountno$index"); >+ push @lines_to_pay, $input->param("accountlines_id$index"); > $amt += $input->param("amountoutstanding$index"); > } > } >-- >2.1.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 14498
:
40807
|
40808
|
40810
| 41602