From 694cbebc8eb041dff6bd4d364874092cc10aa0d0 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 12 Nov 2014 09:27:07 -0500 Subject: [PATCH] Bug 11634 [QA Followup] - Make unit tests pass * Allow on shelf holds needed to be enabled * Added some error supression code for undefined string comparison --- Koha/Calendar.pm | 2 ++ Koha/DateUtils.pm | 2 +- t/db_dependent/Circulation.t | 1 + 3 files changed, 4 insertions(+), 1 deletions(-) diff --git a/Koha/Calendar.pm b/Koha/Calendar.pm index f982ff4..6013a25 100644 --- a/Koha/Calendar.pm +++ b/Koha/Calendar.pm @@ -167,6 +167,8 @@ sub addDays { my ( $self, $startdate, $days_duration ) = @_; my $base_date = $startdate->clone(); + $self->{days_mode} ||= q{}; + if ( $self->{days_mode} eq 'Calendar' ) { # use the calendar to skip all days the library is closed # when adding diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm index b372a3a..1de4000 100644 --- a/Koha/DateUtils.pm +++ b/Koha/DateUtils.pm @@ -128,7 +128,7 @@ sub output_pref { my $pref = defined $force_pref ? $force_pref : C4::Context->preference('dateformat'); - my $time_format = $force_time || C4::Context->preference('TimeFormat'); + my $time_format = $force_time || C4::Context->preference('TimeFormat') || q{}; my $time = ( $time_format eq '12hr' ) ? '%I:%M %p' : '%H:%M'; my $date; if ( $pref =~ m/^iso/ ) { diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index 3a79808..58dbc2b 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -291,6 +291,7 @@ C4::Context->dbh->do("DELETE FROM accountlines"); ); # Testing of feature to allow the renewal of reserved items if other items on the record can fill all needed holds + C4::Context->set_preference('AllowOnShelfHolds', 1 ); C4::Context->set_preference('AllowRenewalIfOtherItemsAvailable', 1 ); ( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber); is( $renewokay, 1, 'Bug 11634 - Allow renewal of item with unfilled holds if other available items can fill those holds'); -- 1.7.2.5