Bug 16430 - Mainpage.pl dies if library is not set
Summary: Mainpage.pl dies if library is not set
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low blocker (vote)
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-03 12:56 UTC by Kyle M Hall
Modified: 2019-06-27 09:24 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16430 - Mainpage.pl dies if library is not set (1.20 KB, patch)
2016-05-03 12:58 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 16430 - Mainpage.pl dies if library is not set (2.00 KB, patch)
2016-05-03 13:04 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2016-05-03 12:56:53 UTC
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!
Comment 1 Kyle M Hall 2016-05-03 12:58:50 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2016-05-03 13:04:58 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2016-05-03 13:07:51 UTC
On further testing, I think this may be a much deeper problem than this.
Comment 4 Kyle M Hall 2016-05-03 13:16:35 UTC
The root case is a change in dt_from_string:

$date_format = C4::Context->preference('dateformat') unless $date_format;

This line means that if the caller does not pass a format, the native preferred format is assumed. When not logged in, $date_format will be empty and cause an error. There are also many calls to dt_from_string where no format is passed which will cause other errors.
Comment 5 Jonathan Druart 2016-05-03 13:25:11 UTC
I'd keep the die, to catch next issues of the same kind.
Comment 6 Jonathan Druart 2016-05-03 14:32:06 UTC
I do not recreate, did you fix the sysprefs.sql file before? See bug 16418
Comment 7 Jonathan Druart 2016-11-10 08:55:55 UTC
This one was invalid, it was caused by a syntax error in sysprefs.sql