Summary: | Cannot view reading record through staff client | ||
---|---|---|---|
Product: | Koha | Reporter: | Kyle M Hall <kyle.m.hall> |
Component: | Patrons | Assignee: | Kyle M Hall <kyle.m.hall> |
Status: | CLOSED FIXED | QA Contact: | Jonathan Druart <jonathan.druart> |
Severity: | normal | ||
Priority: | P5 - low | CC: | chris, gmcharlt, jonathan.druart, kyle.m.hall, kyle, paul.poulain, robin |
Version: | 3.8 | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 8391 - Cannot view reading record through staff client
Bug 8391: prevent error when viewing circ history with bad dates Bug 8391: prevent error when viewing circ history with bad dates |
Description
Kyle M Hall
2012-07-09 12:38:04 UTC
Created attachment 10713 [details] [review] Bug 8391 - Cannot view reading record through staff client This bug reveals itself when attempting to view the reading record of a borrower who currently has items checked out. Readingrec.pl attempts to format the returndate field for both old and current issues, even though current issues have no returndate. This is what is causing the error. Resolved by adding a conditional to check for a valid date before formatting said date. > This bug reveals itself when attempting to view the reading record
> of a borrower who currently has items checked out.
In the issues table, I have returndate=NULL.
How do you manage to fill this value with '0000-00-00 00:00:00' ?
I also have this issue. However, I have what I think is a fix in a more appropriate place (that is, it will sold this problem in more than just a single location.) This occurs for me with some old data when the item was never returned (e.g. lost) and the returndate in old_issues ended up being 0000-00-00 00:00:00. Items checked out correctly have NULL for me. A side effect of this (which is probably best fixed separately) is that things that are lost will say "Checked Out" rather than "Lost" or similar. I will attach my patch (it's more or less the same thing in spirit.) Created attachment 11155 [details] [review] Bug 8391: prevent error when viewing circ history with bad dates Sometime the circ history will contain "0000-00-00" as a returndate when an item was lost rather than returned. This currently causes an error when attempting to parse the dates, this patch causes an empty string to be returned instead. Note: a future enhancement should distinguish between "no date provided" and "invalid date provided" to allow distinctions to be made. Created attachment 11203 [details] [review] Bug 8391: prevent error when viewing circ history with bad dates Sometime the circ history will contain "0000-00-00" as a returndate when an item was lost rather than returned. This currently causes an error when attempting to parse the dates, this patch causes an empty string to be returned instead. Note: a future enhancement should distinguish between "no date provided" and "invalid date provided" to allow distinctions to be made. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> QA Comments: return undef or an empty string if the argument is empty or equal "0000-00-00" Marking as Passed QA see Bug 8532 (same modification for the routine output_pref). Pushed to 3.8.x, will be in 3.8.4, leaving set to Passed QA so Paul can push to master when he is back Patch pushed to master Note that it could solve some errors in other places as well. |