Bug 25664

Summary: login_attempts for imported borrowers can be set to NULL
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: ToolsAssignee: Bugs List <koha-bugs>
Status: CLOSED INVALID QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: jonathan.druart, kelly, kyle
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 24379    
Bug Blocks:    

Description Nick Clemens (kidclamp) 2020-06-03 11:57:51 UTC
On bug 24379 there has been some conversation about login_attempts being set to null.

While it doesn't seem to happen at creation it does during an import

To recreate:
1 - Check your DB
    select distinct login_attempts from borrowers;
2 - All should be 0 (if you have some nulls already, thats ok)
3 - Run a report and download as CSV (you may need to set the delimiter syspref to comma)
   select surname, cardnumber, categorycode, branchcode
   FROM borrowers
4 - Tools -> Import borrowers
5 - Set to match on cardnumber and overwrite patrons
6 - Check the DB after import
    select distinct login_attempts from borrowers;
7 - All login_attempts are NULL
Comment 1 Katrin Fischer 2020-06-11 19:53:13 UTC
hm the column is 'default 0', so I guess the import must explicitly set it to NULL somewhere?
Comment 2 Kyle M Hall (khall) 2021-07-15 11:41:42 UTC
Tested and working in master.