Bugzilla – Attachment 51137 Details for
Bug 16430
Mainpage.pl dies if library is not set
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16430 - Mainpage.pl dies if library is not set
Bug-16430---Mainpagepl-dies-if-library-is-not-set.patch (text/plain), 2.00 KB, created by
Kyle M Hall (khall)
on 2016-05-03 13:04:58 UTC
(
hide
)
Description:
Bug 16430 - Mainpage.pl dies if library is not set
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-05-03 13:04:58 UTC
Size:
2.00 KB
patch
obsolete
>From 1cf3443b6cae95acd5ac985cd9242d0e0d4790e2 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 3 May 2016 12:57:13 +0000 >Subject: [PATCH] Bug 16430 - Mainpage.pl dies if library is not set > >On a fresh install of Koha, logging in I was met with: > >Invalid dateformat parameter () at >/home/vagrant/kohaclone/Koha/DateUtils.pm line 112. > >It appears that if the library is not set, you get this message on >mainpage.pl. Needless to say, this adds difficulty in setting up a fresh >install of Koha! > >Test Plan: >1) Check out master, start with a fresh empty database >2) Go through the installer, install all default data, log in with the db user for the first time >3) Note the error >4) Apply this patch >5) Refresh the page, the error should be gone >--- > C4/NewsChannels.pm | 3 ++- > Koha/DateUtils.pm | 2 +- > 2 files changed, 3 insertions(+), 2 deletions(-) > >diff --git a/C4/NewsChannels.pm b/C4/NewsChannels.pm >index cbcc702..9b7c226 100644 >--- a/C4/NewsChannels.pm >+++ b/C4/NewsChannels.pm >@@ -190,6 +190,7 @@ sub get_opac_news { > > sub GetNewsToDisplay { > my ($lang,$branch) = @_; >+ > my $dbh = C4::Context->dbh; > # SELECT *,DATE_FORMAT(timestamp, '%d/%m/%Y') AS newdate > my $query = q{ >@@ -216,7 +217,7 @@ sub GetNewsToDisplay { > $sth->execute($lang,$branch); > my @results; > while ( my $row = $sth->fetchrow_hashref ){ >- $row->{newdate} = output_pref({ dt => dt_from_string( $row->{newdate} ), dateonly => 1 }); >+ $row->{newdate} = output_pref({ dt => dt_from_string( $row->{newdate}, 'iso' ), dateonly => 1 }); > push @results, $row; > } > return \@results; >diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm >index 6207cc1..e5d3be4 100644 >--- a/Koha/DateUtils.pm >+++ b/Koha/DateUtils.pm >@@ -109,7 +109,7 @@ sub dt_from_string { > $regex = $fallback_re; > } > else { >- die "Invalid dateformat parameter ($date_format)"; >+ carp "Invalid dateformat parameter ($date_format)"; > } > > # Add the faculative time part [hh:mm[:ss]] >-- >2.1.4
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 16430
:
51136
|
51137