Bugzilla – Attachment 125121 Details for
Bug 28952
Item Checkout History fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
0001-Bug-28952-circ-bookcount.pl-watch-for-timestamp-0.patch (text/plain), 1.43 KB, created by
Michael Hafen
on 2021-09-21 19:32:33 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Michael Hafen
Created:
2021-09-21 19:32:33 UTC
Size:
1.43 KB
patch
obsolete
>From dbf1bfd960a4fa931f471af75ab827d7620c497d Mon Sep 17 00:00:00 2001 >From: Michael Hafen <michael.hafen@washk12.org> >Date: Tue, 21 Sep 2021 13:28:27 -0600 >Subject: [PATCH] Bug 28952 - circ/bookcount.pl - watch for timestamp == 0 >Content-Type: text/plain; charset="utf-8" > >In MySQL 8 (probably since 5.7) Timestamp columns can't be '0'. Recent >versions of DBI::Mysql seem to be quoting numbers in placeholders too, >so this bit of sql because "timestamp > '0'". >This causes circ/bookcount.pl, when an item has never been tranfered to >filter on timestamp > '0', which causes MySQL to through an error. > >So convert '0' to '1970-01-01 00:00:00' in issuessince(). This could be >done elsewhere in the script, but that would effect how last transfer date >is shown in the template. > >Test Plan: >Find an item that has never been transfered. >Look at it's circulation history, observe the database error message. >Apply patch. >Reload the items circulation history, observe there is no more error. >--- > circ/bookcount.pl | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/circ/bookcount.pl b/circ/bookcount.pl >index 8509991ac4..8863021724 100755 >--- a/circ/bookcount.pl >+++ b/circ/bookcount.pl >@@ -107,6 +107,9 @@ sub lastmove { > > sub issuessince { > my ( $itemnumber, $date ) = @_; >+ if ( $date eq '0' ) { >+ $date = '1970-01-01 00:00:00'; >+ } > my $dbh = C4::Context->dbh; > my $sth = > $dbh->prepare("SELECT SUM(count) FROM ( >-- >2.25.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28952
:
124504
| 125121