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 <hector.hecaxmmx@gmail.com>
Works as described. QA test tools run OK

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit a84264c92f)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
(cherry picked from commit 9449b27198)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
This commit is contained in:
Mark Tompsett 2016-02-01 18:12:44 -05:00 committed by Frédéric Demians
parent 03e133ba26
commit af4e2c6041
1 changed files with 5 additions and 1 deletions

View File

@ -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' );