Bugzilla – Attachment 11203 Details for
Bug 8391
Cannot view reading record through staff client
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8391: prevent error when viewing circ history with bad dates
Bug-8391-prevent-error-when-viewing-circ-history-w.patch (text/plain), 1.53 KB, created by
Kyle M Hall (khall)
on 2012-07-30 15:41:50 UTC
(
hide
)
Description:
Bug 8391: prevent error when viewing circ history with bad dates
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2012-07-30 15:41:50 UTC
Size:
1.53 KB
patch
obsolete
>From 0cc87b0f71abc309d9a91932d2af594af8665e6b Mon Sep 17 00:00:00 2001 >From: Robin Sheat <robin@catalyst.net.nz> >Date: Fri, 27 Jul 2012 11:34:17 +0200 >Subject: [PATCH] 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> >--- > Koha/DateUtils.pm | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > >diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm >index a1fd088..0b61111 100644 >--- a/Koha/DateUtils.pm >+++ b/Koha/DateUtils.pm >@@ -80,6 +80,7 @@ sub dt_from_string { > } elsif ( $date_format eq 'sql' ) { > $date_string =~ > s/(\d{4})(\d{2})(\d{2})\s+(\d{2})(\d{2})(\d{2})/$1-$2-$3T$4:$5:$6/; >+ return if ($date_string =~ /^0000-00-00/); > $date_string =~ s/00T/01T/; > } > } >@@ -158,6 +159,7 @@ sub format_sqldatetime { > my $force_pref = shift; # if testing we want to override Context > if ( defined $str && $str =~ m/^\d{4}-\d{2}-\d{2}/ ) { > my $dt = dt_from_string( $str, 'sql' ); >+ return q{} unless $dt; > $dt->truncate( to => 'minute' ); > return output_pref( $dt, $force_pref ); > } >-- >1.7.2.5
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 8391
:
10713
|
11155
| 11203