Bug 14717 - Prevent 0000-00-00 dates in patron data
Summary: Prevent 0000-00-00 dates in patron data
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Chris Cormack
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-24 21:48 UTC by Chris Cormack
Modified: 2019-06-27 09:24 UTC (History)
5 users (show)

See Also:
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 (1.23 KB, patch)
2015-08-24 22:03 UTC, Chris Cormack
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14717: Invalid dates in debarred column (1.31 KB, patch)
2015-09-03 14:36 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 14717: Invalid dates in debarred column (1.35 KB, patch)
2015-09-03 15:09 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14717: Prevent 0000-00-00 on updating a patron (3.81 KB, patch)
2015-09-03 15:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14171: Update borrowers date fields (1.21 KB, patch)
2015-09-03 15:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED QA] Bug 14717: Invalid dates in debarred column (1.42 KB, patch)
2015-09-03 21:22 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 14717: Prevent 0000-00-00 on updating a patron (3.88 KB, patch)
2015-09-03 21:22 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 14171: Update borrowers date fields (1.28 KB, patch)
2015-09-03 21:22 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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