Bug 8532

Summary: Old/iffy data causes error checking out
Product: Koha Reporter: Robin Sheat <robin>
Component: CirculationAssignee: Robin Sheat <robin>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P3 CC: chris, christophe.croullebois, gmcharlt, jonathan.druart, kyle.m.hall, paul.poulain
Version: 3.8   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 8532 - improve robustness when converting dates
Bug 8532 - improve robustness when converting dates

Description Robin Sheat 2012-07-31 11:20:13 UTC
In some cases (I don't really know the cause, but it doesn't matter) the issuedate in the 'old_issues' table ends up with NULL. In the case, there is an error when converting that date to the proper form during circulation (possibly happens elsewhere too, but that's where I saw it.)
Comment 1 Robin Sheat 2012-07-31 11:26:39 UTC Comment hidden (obsolete)
Comment 2 Robin Sheat 2012-07-31 11:27:51 UTC
This should be put into 3.8 also.
Comment 3 Jonathan Druart 2012-08-01 14:23:12 UTC
Created attachment 11261 [details] [review]
Bug 8532 - improve robustness when converting dates

If undef is passed to the date format conversion function, it dies. This
can happen when you have old data in the database. Better to handle it
in some fashion rather than die, so now it just returns undef too.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
I replace "return undef" with just "return" to pass perlcritic
Comment 4 Jonathan Druart 2012-08-06 12:37:35 UTC
*** Bug 8537 has been marked as a duplicate of this bug. ***
Comment 5 Chris Cormack 2012-08-06 20:42:38 UTC
Marcel if you could QA this, that would be fantastic!
Comment 6 Marcel de Rooy 2012-08-07 12:58:52 UTC
Tiny patch, handling passed undefs. Passed QA
Comment 7 Chris Cormack 2012-08-07 20:52:53 UTC
Pushed to 3.8.x, will be in 3.8.4
Comment 8 Paul Poulain 2012-08-31 15:31:23 UTC
pushed to master. Already on stable, changing status accordingly