From af4e2c60419ea007b75f2246d032b6de213cd2c8 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Jonathan Druart Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com (cherry picked from commit a84264c92f4c34607fba09f109610e40611078a9) Signed-off-by: Julian Maurice (cherry picked from commit 9449b27198a1f8f24dde0675fe6230cb977c4cf0) Signed-off-by: Frédéric Demians --- C4/Languages.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/C4/Languages.pm b/C4/Languages.pm index 384fd7a750..95bc1144e4 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' ); -- 2.39.5