Bugzilla – Attachment 48190 Details for
Bug 15842
Cannot import patrons if the csv file does not contain privacy_guarantor_checkouts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15842 - Cannot import patrons if the csv file does not contain privacy_guarantor_checkouts
Bug-15842---Cannot-import-patrons-if-the-csv-file-.patch (text/plain), 2.03 KB, created by
Kyle M Hall (khall)
on 2016-02-17 15:51:09 UTC
(
hide
)
Description:
Bug 15842 - Cannot import patrons if the csv file does not contain privacy_guarantor_checkouts
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-02-17 15:51:09 UTC
Size:
2.03 KB
patch
obsolete
>From 10a03d342b84385ec54917a836d8cfee32c621ea Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 15 Feb 2016 12:58:14 +0000 >Subject: [PATCH] Bug 15842 - Cannot import patrons if the csv file does not > contain privacy_guarantor_checkouts > >When importing patrons with a csv file which does not contain the privacy_guarantor_checkouts column in the header, you will get >DBIx::Class::Storage::DBI::_dbh_execute(): Column 'privacy_guarantor_checkouts' cannot be null at /home/koha/src/C4/Members.pm line 768 > >The same issue seems to occur for sms_provider_id. > >Test Plan: >1) Attempt to import patron csv file with no privacy_guarantor_checkouts column >2) Note the error >3) Apply this patch >4) Repeat step 1 >5) The error should no longer occur >--- > C4/Members.pm | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 9f835f6..5bdb0fe 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -749,6 +749,9 @@ sub AddMember { > : $patron_category->default_privacy() eq 'never' ? 2 > : $patron_category->default_privacy() eq 'forever' ? 0 > : undef; >+ >+ $data{'privacy_guarantor_checkouts'} = 0 unless defined( $data{'privacy_guarantor_checkouts'} ); >+ > # Make a copy of the plain text password for later use > my $plain_text_password = $data{'password'}; > >@@ -756,8 +759,9 @@ sub AddMember { > $data{'password'} = ($data{'password'})? hash_password($data{'password'}) : '!'; > > # we don't want invalid dates in the db (mysql has a bad habit of inserting 0000-00-00 >- $data{'dateofbirth'} = undef if( not $data{'dateofbirth'} ); >- $data{'debarred'} = undef if ( not $data{'debarred'} ); >+ $data{'dateofbirth'} = undef if ( not $data{'dateofbirth'} ); >+ $data{'debarred'} = undef if ( not $data{'debarred'} ); >+ $data{'sms_provider_id'} = undef if ( not $data{'sms_provider_id'} ); > > # get only the columns of Borrower > my @columns = $schema->source('Borrower')->columns; >-- >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 15842
:
48190
|
48263
|
48434