From a1c8a07428d25fd668e0b929e8147442445dcdaf Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Mon, 1 Feb 2016 18:12:44 -0500 Subject: [PATCH] Bug 15719: Silence warning in C4/Language.pm during web install This problem was discovered the hard way: - Drop DB - Create DB - Webinstaller run until the screen is: We are ready to do some basic configuration. Please install basic configuration settings to continue the installation. -- The error log file will end with an error about splitting an uninitialized value. TEST PLAN --------- 0) First patch already applied 1) prove -v t/Languages.t -- success, but warn prints 2) Apply this patch 3) prove -v t/Languages.t -- success without warning messages 4) run koha qa test tools Signed-off-by: Hector Castro Works as described. QA test tools run OK --- C4/Languages.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/C4/Languages.pm b/C4/Languages.pm index 384fd7a..95bc114 100644 --- a/C4/Languages.pm +++ b/C4/Languages.pm @@ -578,7 +578,11 @@ sub getlanguage { my $preference_to_check = $interface eq 'intranet' ? 'language' : 'opaclanguages'; # Get the available/valid languages list - my @languages = split /,/, C4::Context->preference($preference_to_check); + my @languages; + my $preference_value = C4::Context->preference($preference_to_check); + if ($preference_value) { + @languages = split /,/, $preference_value; + } # Chose language from the URL $language = $cgi->param( 'language' ); -- 1.7.10.4