Bugzilla – Attachment 39909 Details for
Bug 14339
Installer broken by bug 13967
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14339: C4::Context->preference should return undef if DB is not populated
Bug-14339-C4Context-preference-should-return-undef.patch (text/plain), 1.55 KB, created by
Mark Tompsett
on 2015-06-05 14:34:57 UTC
(
hide
)
Description:
Bug 14339: C4::Context->preference should return undef if DB is not populated
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2015-06-05 14:34:57 UTC
Size:
1.55 KB
patch
obsolete
>From 390c1fc56d53b6a3571bb6921dc10c0b636a842c Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Fri, 5 Jun 2015 10:56:56 -0300 >Subject: [PATCH] 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> >--- > C4/Context.pm | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/C4/Context.pm b/C4/Context.pm >index 099ddaf..3e3f00c 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -527,7 +527,8 @@ sub preference { > if ( defined $ENV{"OVERRIDE_SYSPREF_$var"} ) { > $value = $ENV{"OVERRIDE_SYSPREF_$var"}; > } else { >- my $syspref = Koha::Config::SysPrefs->find( lc $var ); >+ my $syspref; >+ eval { $syspref = Koha::Config::SysPrefs->find( lc $var ) }; > $value = $syspref ? $syspref->value() : undef; > } > >-- >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 14339
:
39906
|
39909
|
39917
|
39923