Bug 14339 - Installer broken by bug 13967
Summary: Installer broken by bug 13967
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (web-based installer) (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Kyle M Hall
URL:
Keywords:
Depends on: 13967
Blocks:
  Show dependency treegraph
 
Reported: 2015-06-05 13:20 UTC by Tomás Cohen Arazi
Modified: 2016-06-21 21:40 UTC (History)
3 users (show)

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


Attachments
Bug 14339: C4::Context->preference should return undef if DB is not populated (1.50 KB, patch)
2015-06-05 14:15 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14339: C4::Context->preference should return undef if DB is not populated (1.55 KB, patch)
2015-06-05 14:34 UTC, Mark Tompsett
Details | Diff | Splinter Review
[PASSED QA] Bug 14339: C4::Context->preference should return undef if DB is not populated (1.62 KB, patch)
2015-06-05 18:07 UTC, Kyle M Hall
Details | Diff | Splinter Review
[PASSED QA] Bug 14339: C4::Context->preference should return undef if DB is not populated (1.67 KB, patch)
2015-06-05 20:24 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2015-06-05 13:20:47 UTC
The introduction of the new Koha::Config::SysPrefs package slightly changed the behaviour on syspref retrieval by not catching DB errors (notably when there is no DB structure :-/, which should be detected and redirected to the installer/maintenance depending on the interface)
Comment 1 Tomás Cohen Arazi 2015-06-05 14:15:09 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2015-06-05 14:34:57 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2015-06-05 18:07:37 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2015-06-05 20:24:33 UTC
Created attachment 39923 [details] [review]
[PASSED QA] Bug 14339: C4::Context->preference should return undef if DB is not populated

The current behaviour for C4::Context->preference when the DB is not still
populated with tables is to return undef. This is used by C4::Auth to identify
the need of running the installer.

This behaviour got broken by bug 13967, which lets DB errors to escalate and
thus Koha gets broken instead of prompting for install.

This patch wraps Koha::Config::Sysprefs->find inside an eval and sets undef if needed.

To test:
- In current master, drop the DB
- Load OPAC and Intranet
=> FAIL: notice an ugly software error.
- Apply the patch
- Load the OPAC
=> SUCCESS: Maintenance mode screen is shown
- Load Intranet
=> SUCCESS: You are prompted the DB credentials to run the web installer.
- Sign off :-D

Tomas

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Tomás Cohen Arazi 2015-06-07 22:00:44 UTC
Patch pushed to master.