From 77c926e943f59a5ad739e3112817d5650d883a71 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 13 Jul 2016 15:41:30 +0000 Subject: [PATCH] Bug 16917 - Error when importing patrons, Column 'checkprevcheckout' cannot be null Error: DBIx::Class::Storage::DBI::_dbh_execute(): Column 'checkprevcheckout' cannot be null at C4/Members.pm line 697 Test Plan: 1) Attempt to import a patron via csv 2) Note the error 3) Apply this patch 4) Repeat the import 5) No error! NOTE: Given that all the other tests ran (comment #2), except those in comment #3, I resorted to following the test plan above using the attachment provided in comment #5. I believe the issues in comment #3 constitute other bugs which need fixing and are unrelated this bug. Applying the patch does resolve the error triggered, and the code is good. Signed-off-by: Mark Tompsett --- C4/Members.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/C4/Members.pm b/C4/Members.pm index f9b3942..677e221 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -726,6 +726,7 @@ sub AddMember { # get only the columns of Borrower my @columns = $schema->source('Borrower')->columns; my $new_member = { map { join(' ',@columns) =~ /$_/ ? ( $_ => $data{$_} ) : () } keys(%data) } ; + $new_member->{checkprevcheckout} ||= 'inherit'; delete $new_member->{borrowernumber}; my $rs = $schema->resultset('Borrower'); -- 2.1.4