Bug 16917 - Error when importing patrons, Column 'checkprevcheckout' cannot be null
Summary: Error when importing patrons, Column 'checkprevcheckout' cannot be null
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low blocker (vote)
Target Milestone: Oldversions
Assignee: Kyle M Hall
QA Contact: Marcel de Rooy
URL:
Whiteboard:
Keywords:
Depends on: 6906
Blocks: 16889 17034 17080
  Show dependency treegraph
 
Reported: 2016-07-13 15:40 UTC by Kyle M Hall
Modified: 2018-12-16 19:32 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16917 - Error when importing patrons, Column 'checkprevcheckout' cannot be null (1.03 KB, patch)
2016-07-13 15:43 UTC, Kyle M Hall
Details | Diff | Splinter Review
Test CSV File (854 bytes, text/csv)
2016-07-14 14:30 UTC, Kyle M Hall
Details
Bug 16917 - Error when importing patrons, Column 'checkprevcheckout' cannot be null (1.46 KB, patch)
2016-07-15 01:17 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 16917 - Error when importing patrons, Column 'checkprevcheckout' cannot be null (1.56 KB, patch)
2016-07-15 07:14 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2016-07-13 15:40:54 UTC
Error:
DBIx::Class::Storage::DBI::_dbh_execute(): Column 'checkprevcheckout' cannot be null at C4/Members.pm line 697
Comment 1 Kyle M Hall 2016-07-13 15:43:10 UTC Comment hidden (obsolete)
Comment 2 M. Tompsett 2016-07-14 02:24:21 UTC
I added a line:
 die "TRIGGER!" if !$new_member->{checkprevcheckout};
into C4::Members just above the change, and then ran prove t/db_dependent.

TRIGGERED: t/db_dependent/Budgets.t
TRIGGERED: t/db_dependent/Circulation.t
  RELATED: t/db_dependent/DecreaseLoanHighHolds.t
TRIGGERED: t/db_dependent/Holds.t
TRIGGERED: t/db_dependent/Letters.t
TRIGGERED: t/db_dependent/Members.t
TRIGGERED: t/db_dependent/Ratings.t
TRIGGERED: t/db_dependent/Reserves.t
TRIGGERED: t/db_dependent/Serials_2.t
TRIGGERED: t/db_dependent/Suggestions.t

So, now to remove that line of code and run these tests.
Comment 3 M. Tompsett 2016-07-14 03:50:18 UTC
Tracing down failures:
t/db_dependent/Circulation.t
t/db_dependent/DecreaseLoanHighHolds.t
t/db_dependent/Reserves.t
These all fail on master too, so I'll fall back to the provided test plan.
Comment 4 M. Tompsett 2016-07-14 04:12:30 UTC
Please provide a sample patron CSV that triggers issue.
I attempted with checkprevcheckout deleted, and then set to 'null'.
I tried both new and overwrite.
Comment 5 Kyle M Hall 2016-07-14 14:30:57 UTC
Created attachment 53398 [details]
Test CSV File

This file caused the error for me.
Comment 6 M. Tompsett 2016-07-15 01:17:03 UTC Comment hidden (obsolete)
Comment 7 Marcel de Rooy 2016-07-15 07:14:10 UTC
Created attachment 53412 [details] [review]
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 <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 8 Kyle M Hall 2016-07-15 14:04:29 UTC
Pushed to master for 16.11!
Comment 9 Frédéric Demians 2016-08-01 13:36:59 UTC
Pushed in 16.05. Will be in 16.05.02.
Comment 10 Frédéric Demians 2016-08-03 06:24:23 UTC
Reverted. Shouldn't be in 16.05.
Comment 11 Julian Maurice 2016-08-17 08:58:29 UTC
Not needed in 3.22.x