[Bug 28952] New: Item Checkout History fails
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28952 Bug ID: 28952 Summary: Item Checkout History fails Change sponsored?: --- Product: Koha Version: 21.05 Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: beardst@rlasd.net QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Created attachment 124504 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=124504&action=edit MySQL output We are getting an error whenever trying to view an item's checkout history. This is happening on all items that we have tested /cgi-bin/koha/circ/bookcount.pl?&biblionumber=33518&itm=18222 Results in a 500 error The Plack error log reports CGI::Compile::ROOT::usr_share_koha_intranet_cgi_2dbin_circ_bookcount_2epl::issuessince(): DBI Exception: DBD::mysql::st execute failed: Incorrect TIMESTAMP value: '0' [for Statement "SELECT SUM(count) FROM ( SELECT COUNT(*) AS count FROM issues WHERE itemnumber = ? and timestamp > ? UNION ALL SELECT COUNT(*) AS count FROM old_issues WHERE itemnumber = ? and timestamp > ? ) tmp" with ParamValues: 0="18222", 1=0, 2="18222", 3=0] at /usr/share/koha/intranet/cgi-bin/circ/bookcount.pl line 63 If I run the above sql statement with the variables populated it returns information. Screenshot is attached. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28952 Michael Hafen <michael.hafen@washk12.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michael.hafen@washk12.org --- Comment #1 from Michael Hafen <michael.hafen@washk12.org> --- I also ran into this error. The reason it seemed to work from the sql is that the placeholder causes the '0' to be quoted. Try the sql with the '0' quoted and you will see the same error. Not sure what the best way to handle this is. Perhaps watch for $date eq 0 in the issuessince() sub and convert it to '1970-01-01 00:00:00'? (In reply to beardst from comment #0)
Created attachment 124504 [details] MySQL output
We are getting an error whenever trying to view an item's checkout history. This is happening on all items that we have tested
/cgi-bin/koha/circ/bookcount.pl?&biblionumber=33518&itm=18222
Results in a 500 error
The Plack error log reports
CGI::Compile::ROOT::usr_share_koha_intranet_cgi_2dbin_circ_bookcount_2epl:: issuessince(): DBI Exception: DBD::mysql::st execute failed: Incorrect TIMESTAMP value: '0' [for Statement "SELECT SUM(count) FROM ( SELECT COUNT(*) AS count FROM issues WHERE itemnumber = ? and timestamp > ? UNION ALL SELECT COUNT(*) AS count FROM old_issues WHERE itemnumber = ? and timestamp > ? ) tmp" with ParamValues: 0="18222", 1=0, 2="18222", 3=0] at /usr/share/koha/intranet/cgi-bin/circ/bookcount.pl line 63
If I run the above sql statement with the variables populated it returns information. Screenshot is attached.
-- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28952 --- Comment #2 from Michael Hafen <michael.hafen@washk12.org> --- Created attachment 125121 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125121&action=edit Proposed patch One possible solution. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28952 --- Comment #3 from beardst@rlasd.net --- That fixed it for us. Thanks for the patch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28952 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #4 from Owen Leonard <oleonard@myacpl.org> --- I'm assuming that this has been fixed, or is no longer valid -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org