Skip to content

Commit

Permalink
Bug 16917 - Error when importing patrons, Column 'checkprevcheckout' …
Browse files Browse the repository at this point in the history
…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 <[email protected]>
Signed-off-by: Marcel de Rooy <[email protected]>

Signed-off-by: Kyle M Hall <[email protected]>
  • Loading branch information
kylemhall authored and xmorave2 committed Oct 11, 2016
1 parent 9e0e78c commit b867fac
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions C4/Members.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit b867fac

Please sign in to comment.