Bugzilla – Attachment 33590 Details for
Bug 13242
Slow checkin for patrons restricted indefinitely
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13242: Fix DateUtils for 'infinite' dates (ie year 9999)
Bug-13242-Fix-DateUtils-for-infinite-dates-ie-year.patch (text/plain), 1.70 KB, created by
Frédéric Demians
on 2014-11-15 12:17:00 UTC
(
hide
)
Description:
Bug 13242: Fix DateUtils for 'infinite' dates (ie year 9999)
Filename:
MIME Type:
Creator:
Frédéric Demians
Created:
2014-11-15 12:17:00 UTC
Size:
1.70 KB
patch
obsolete
>From a6b48829ff9b87c974bf64368c0344b8147fd796 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= <f.demians@tamil.fr> >Date: Sat, 15 Nov 2014 13:23:06 +0100 >Subject: [PATCH] Bug 13242: Fix DateUtils for 'infinite' dates (ie year 9999) > >TEST PLAN: > >- Method 1--with UT > > - Use the UT associated to this bug, without applying this patch, and then > after applying this patch > >- Method 2--using Koha > > - Without this patch > - Find a borrower with several checkouts that are not overdue. > - Debarred the borrower > - Go on circ/circulation-home.pl page > - Select Check in tab, and do a check in > - It required more than 20s to display the return.pl page > - Apply the patch, and repeat previous steps > => return.pl is immediately displayed. >--- > Koha/DateUtils.pm | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > >diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm >index 1de4000..6c0a68e 100644 >--- a/Koha/DateUtils.pm >+++ b/Koha/DateUtils.pm >@@ -53,6 +53,11 @@ to the system preferences. If the date string is empty DateTime->now is returned > > sub dt_from_string { > my ( $date_string, $date_format, $tz ) = @_; >+ >+ # FIXME: see bug 13242 => no TZ for dates 'infinite' >+ return DateTime::Format::DateParse->parse_datetime($date_string) >+ if $date_string =~ /^9999-/; >+ > if ( !$tz ) { > $tz = C4::Context->tz; > } >@@ -123,7 +128,8 @@ sub output_pref { > > return unless defined $dt; > >- $dt->set_time_zone( C4::Context->tz ); >+ # FIXME: see bug 13242 => no TZ for dates 'infinite' >+ $dt->set_time_zone( C4::Context->tz ) if $dt->ymd !~ /^9999/; > > my $pref = > defined $force_pref ? $force_pref : C4::Context->preference('dateformat'); >-- >2.1.2
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 13242
:
33510
|
33511
|
33560
|
33561
|
33564
|
33565
|
33589
|
33590
|
33591
|
33592
|
33596
|
33597
|
33945