Bugzilla – Attachment 33944 Details for
Bug 13261
Better check in message for patrons with indefinite restriction
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13261: Remove warning if no parameter given
Bug-13261-Remove-warning-if-no-parameter-given.patch (text/plain), 1.92 KB, created by
Jonathan Druart
on 2014-11-26 08:45:10 UTC
(
hide
)
Description:
Bug 13261: Remove warning if no parameter given
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-11-26 08:45:10 UTC
Size:
1.92 KB
patch
obsolete
>From 913c0046058b7e6163062b078cc4f0af063a5755 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 26 Nov 2014 09:41:36 +0100 >Subject: [PATCH] Bug 13261: Remove warning if no parameter given > >Without any parameter, dt_from_string should not raise a warning >message. > >Test plan: >Verify that the test file t/DateUtils.t displays a warning: > > Use of uninitialized value $date_string in pattern match (m//) at > Koha/DateUtils.pm line 58 > >if the change in dt_from_string is not applied (manually edit the file). >--- > Koha/DateUtils.pm | 2 +- > t/DateUtils.t | 5 ++++- > 2 files changed, 5 insertions(+), 2 deletions(-) > >diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm >index 6c0a68e..4358137 100644 >--- a/Koha/DateUtils.pm >+++ b/Koha/DateUtils.pm >@@ -56,7 +56,7 @@ sub dt_from_string { > > # FIXME: see bug 13242 => no TZ for dates 'infinite' > return DateTime::Format::DateParse->parse_datetime($date_string) >- if $date_string =~ /^9999-/; >+ if $date_string and $date_string =~ /^9999-/; > > if ( !$tz ) { > $tz = C4::Context->tz; >diff --git a/t/DateUtils.t b/t/DateUtils.t >index 2439127..6030e68 100755 >--- a/t/DateUtils.t >+++ b/t/DateUtils.t >@@ -3,7 +3,7 @@ use DateTime; > use DateTime::TimeZone; > > use C4::Context; >-use Test::More tests => 41; >+use Test::More tests => 42; > use Test::MockModule; > use Time::HiRes qw/ gettimeofday /; > >@@ -159,3 +159,6 @@ $date_string = output_pref({ dt => $dt, dateformat => 'metric', timeformat => '2 > cmp_ok $date_string, 'eq', '11/12/2013 18:35', 'as_due_date with hours and timeformat 24hr (non-midnight time)'; > $date_string = output_pref({ dt => $dt, dateformat => 'us', timeformat => '12hr', as_due_date => 1 }); > cmp_ok $date_string, 'eq', '12/11/2013 06:35 PM', 'as_due_date with hours and timeformat 12hr (non-midnight time)'; >+ >+my $now = DateTime->now; >+is( dt_from_string, $now, "Without parameter, dt_from_string should return today" ); >-- >2.1.0
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 13261
:
33593
|
33594
|
33595
|
33619
|
33630
|
33944