Bugzilla – Attachment 38642 Details for
Bug 11929
patron modification error shows borrowernumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11929 - patron modification error shows borrowernumber
Bug-11929---patron-modification-error-shows-borrow.patch (text/plain), 3.37 KB, created by
Mark Tompsett
on 2015-04-29 08:00:45 UTC
(
hide
)
Description:
Bug 11929 - patron modification error shows borrowernumber
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2015-04-29 08:00:45 UTC
Size:
3.37 KB
patch
obsolete
>From ba2db738d1f24b1efdc00302136a1fdcc588d236 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Sun, 26 Apr 2015 21:36:25 +0200 >Subject: [PATCH] Bug 11929 - patron modification error shows borrowernumber > >If an error occurs in patron batch modification, a message similar to the following is displayed: >Can not update patron with borrowernumber 7055 > >It would be useful to have the cardnumber as well. > >This patch adds the card number to the lists of errors. > >It is not easy to trigger an error (see comments). >For testing, I tweaked the sub ModMember in C4/Members.pm to always return false. > >TEST PLAN >--------- >1) Log in as a superlibrarian and create a test user >2) Change the cardnumber to a number differing from the > borrower number. >3) Home -> Tools -> Batch patron modification >4) Type in the cardnumber of that test user >5) Check the Library checkbox. >6) Click Save > -- nice error, but it is only the card number. >7) Apply the patch >8) Repeat steps 3-6 > -- nice error, but it is now more informative. >9) run koha qa test tools. > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt | 7 +++++-- > tools/modborrowers.pl | 6 +++++- > 2 files changed, 10 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >index 66680c9..65ce440 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >@@ -199,7 +199,10 @@ > <ul class="warnings"> > [% FOREACH error IN errors %] > [% IF ( error.error == 'can_not_update' ) %] >- <li>Can not update patron with borrowernumber [% error.borrowernumber %]</li> >+ <li>Can not update patron. >+ [% IF ( error.cardnumber ) %] Cardnumber: [% error.cardnumber %] [% END %] >+ (Borrowernumber: [% error.borrowernumber %]) >+ </li> > [% ELSE %] > <li>[% error.error %]</li> > [% END %] >@@ -379,4 +382,4 @@ > [% INCLUDE 'tools-menu.inc' %] > </div> > </div> >-[% INCLUDE 'intranet-bottom.inc' %] >\ No newline at end of file >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl >index 894b632..4172bc3 100755 >--- a/tools/modborrowers.pl >+++ b/tools/modborrowers.pl >@@ -272,7 +272,11 @@ if ( $op eq 'do' ) { > if ( defined $infos ) { > $infos->{borrowernumber} = $borrowernumber; > my $success = ModMember(%$infos); >- push @errors, { error => "can_not_update", borrowernumber => $infos->{borrowernumber} } if not $success; >+ if (!$success) { >+ my $borrowerinfo = GetBorrowerInfos( borrowernumber => $borrowernumber ); >+ $infos->{cardnumber} = $borrowerinfo->{cardnumber} || ''; >+ push @errors, { error => "can_not_update", borrowernumber => $infos->{borrowernumber}, cardnumber => $infos->{cardnumber} }; >+ } > } > > # >-- >2.1.4
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 11929
:
38520
|
38642
|
38643
|
38645