Bugzilla – Attachment 43977 Details for
Bug 15010
Import patron tool creates 'duplicate' restrictions ( debarments )
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15010 - Import patron tool creates 'duplicate' restrictions ( debarments )
Bug-15010---Import-patron-tool-creates-duplicate-r.patch (text/plain), 2.38 KB, created by
Jonathan Druart
on 2015-10-26 09:31:21 UTC
(
hide
)
Description:
Bug 15010 - Import patron tool creates 'duplicate' restrictions ( debarments )
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-10-26 09:31:21 UTC
Size:
2.38 KB
patch
obsolete
>From 65988e1e00839028b65de93dba0939e8fb6501d2 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 14 Oct 2015 08:48:30 -0400 >Subject: [PATCH] Bug 15010 - Import patron tool creates 'duplicate' > restrictions ( debarments ) > >If a patron has restrictions and a CSV file of patrons to be overwritten >is uploaded but has no debarred / debarredcomment columns, the a new >restriction will be added that combines all the existing restrictions ( >i.e. a new debarment based on the existing borrowers.debarred >and borrowers.debarredcomment fields ). > >Test Plan: >1) Create a patron with one or more restrictions >2) Import a CSV file that updates that patron, but with no debarred columns >3) Note a new restrictions is created >4) Delete the new restriction >5) Apply this patch >6) Re-import the CSV file again >7) Note that no new restriction is created >8) Add debarred and debarredcomment columns to the CSV file with a test > date and description >9) Re-import the CSV file again >10) Note the new restriction is added to the patron > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Daniel Grobani <dgrobani@samuelmerritt.edu> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > tools/import_borrowers.pl | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/tools/import_borrowers.pl b/tools/import_borrowers.pl >index e29a980..80d2fed 100755 >--- a/tools/import_borrowers.pl >+++ b/tools/import_borrowers.pl >@@ -283,7 +283,9 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) { > $template->param('lastinvalid'=>$borrower{'surname'}.' / '.$borrowernumber); > next LINE; > } >- if ( $borrower{debarred} ) { >+ >+ # Don't add a new restriction if the existing 'combined' restriction matches this one >+ if ( $borrower{debarred} && ( ( $borrower{debarred} ne $member->{debarred} ) || ( $borrower{debarredcomment} ne $member->{debarredcomment} ) ) ) { > # Check to see if this debarment already exists > my $debarrments = GetDebarments( > { >@@ -303,6 +305,7 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) { > ); > } > } >+ > if ($extended) { > if ($ext_preserve) { > my $old_attributes = GetBorrowerAttributes($borrowernumber); >-- >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 15010
:
43398
|
43607
| 43977