Bug 14717

Summary: Prevent 0000-00-00 dates in patron data
Product: Koha Reporter: Chris Cormack <chris>
Component: PatronsAssignee: Chris Cormack <chris>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: eugenegf, gmcharlt, jonathan.druart, kyle.m.hall, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15155
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 14717: Invalid dates in debarred column
[SIGNED-OFF] Bug 14717: Invalid dates in debarred column
Bug 14717: Invalid dates in debarred column
Bug 14717: Prevent 0000-00-00 on updating a patron
Bug 14171: Update borrowers date fields
[PASSED QA] Bug 14717: Invalid dates in debarred column
[PASSED QA] Bug 14717: Prevent 0000-00-00 on updating a patron
[PASSED QA] Bug 14171: Update borrowers date fields

Description Chris Cormack 2015-08-24 21:48:00 UTC
Bug 12633 introduced a bug, that where debarred is blank, the column is being filled with 0000-00-00

You can test this by importing a patron using the import tool, the patron must have no debarred date set. 
Then check in the DB and you will notice it has an invalid date 0000-00-00

This in turn makes Koha error in circulation as we try to truncate and invalid date object. 


Adding $data{'debarred'} = undef if( not $data{'debarred'} ); to the AddMembers subroutine should fix this issue.
Comment 1 Chris Cormack 2015-08-24 22:03:25 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2015-09-02 22:40:51 UTC
Ohh look an easily testable patch that fixes a major bug .. just waiting for Global bug squash day :)
Comment 3 Eugene Espinoza 2015-09-03 14:31:06 UTC
I tested this during GBSD together with Kyle. And the patch works!
Comment 4 Kyle M Hall (khall) 2015-09-03 14:36:32 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2015-09-03 15:09:59 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2015-09-03 15:10:05 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2015-09-03 15:10:08 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2015-09-03 15:11:22 UTC
I think we should go further here.
Can I get a QA on the new patches?
Comment 9 Katrin Fischer 2015-09-03 21:22:02 UTC
Created attachment 42356 [details] [review]
[PASSED QA] Bug 14717: Invalid dates in debarred column

To test
1/ Import a patron using the patron import tool, make sure they have
no debarred column in the file
2/ Check the database, notice the debarred column is 0000-00-00
3/ For bonus points, checkout an item to that borrower, then check it in
notice Koha errors
4/ Apply patch
5/ Import a new patron
6/ Notice column is now NULL and that checkins work

Signed-off-by: Eugene Espinoza <eugenegf@yahoo.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Katrin Fischer 2015-09-03 21:22:05 UTC
Created attachment 42357 [details] [review]
[PASSED QA] Bug 14717: Prevent 0000-00-00 on updating a patron

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2015-09-03 21:22:08 UTC
Created attachment 42358 [details] [review]
[PASSED QA] Bug 14171: Update borrowers date fields

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

http://bugs.koha-community.org/show_bug.cgi?id=14717

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Tomás Cohen Arazi (tcohen) 2015-09-07 14:29:59 UTC
Patches pushed to master.

Good catch Chris!
Comment 13 Chris Cormack 2015-09-22 01:55:34 UTC
Pushed to 3.20.x will be in 3.20.4