From 9fad61c4881f0c9b6ef39e8b2ceca7cec3779b3b Mon Sep 17 00:00:00 2001 From: Kyle M Hall 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, 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 +++ 1 file changed, 3 insertions(+) diff --git a/C4/NewsChannels.pm b/C4/NewsChannels.pm index cbcc702..7a7b72a 100644 --- a/C4/NewsChannels.pm +++ b/C4/NewsChannels.pm @@ -190,6 +190,9 @@ sub get_opac_news { sub GetNewsToDisplay { my ($lang,$branch) = @_; + + return [] unless $branch && $branch ne 'NO_LIBRARY_SET'; + my $dbh = C4::Context->dbh; # SELECT *,DATE_FORMAT(timestamp, '%d/%m/%Y') AS newdate my $query = q{ -- 2.1.4