Bug 15719

Summary: Silence warning in C4/Language.pm during web install
Product: Koha Reporter: Mark Tompsett <mtompset>
Component: Installation and upgrade (web-based installer)Assignee: Mark Tompsett <mtompset>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: brendan, f.demians, gmcharlt, indradg, jonathan.druart, julian.maurice
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 15719: Silence warning in C4/Language.pm during web install
Bug 15719: Silence warning in C4/Language.pm during web install
[SIGNED-OFF]Bug 15719: Silence warning in C4/Language.pm during web install
Bug 15719: Silence warning in C4/Language.pm during web install
Bug 15719: Silence warning in C4/Language.pm during web install - tests
Bug 15719: Silence warning in C4/Language.pm during web install

Description Mark Tompsett 2016-02-01 23:37:26 UTC
This problem was discovered the hard way:
Drop DB
Create DB
Webinstaller run until the screen says:
We are ready to do some basic configuration. Please install basic configuration settings to continue the installation.
The error log file will contain an error about splitting an uninitialized value.
Apply the patch
Drop DB
Create DB
Webinstaller run until the screen says:
We are ready to do some basic configuration. Please install basic configuration settings to continue the installation.
The error log file will not contain that error.
Comment 1 Mark Tompsett 2016-02-01 23:41:30 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2016-02-01 23:41:37 UTC Comment hidden (obsolete)
Comment 3 Héctor Eduardo Castro Avalos 2016-02-08 16:40:31 UTC Comment hidden (obsolete)
Comment 4 Héctor Eduardo Castro Avalos 2016-02-08 16:40:46 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2016-02-09 12:36:46 UTC
Created attachment 47806 [details] [review]
Bug 15719: Silence warning in C4/Language.pm during web install - tests

Test empty database case.

TEST PLAN
---------
1) prove -v t/Languages.t
   -- success (because test case is missing)
2) Apply this patch
3) prove -v t/Languages.t
   -- success, but warning printed.
4) run koha qa test tools

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised. QA test tools rus OK

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Jonathan Druart 2016-02-09 12:36:50 UTC
Created attachment 47807 [details] [review]
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>
Comment 7 Jonathan Druart 2016-02-09 12:38:58 UTC
Much more readable (IMO) would have been
  my @languages = C4::Context->preference($preference_to_check)
     ? split /,/, C4::Context->preference($preference_to_check)
     : ()
Comment 8 Mark Tompsett 2016-02-09 16:16:37 UTC
(In reply to Jonathan Druart from comment #7)
> Much more readable (IMO) would have been
>   my @languages = C4::Context->preference($preference_to_check)
>      ? split /,/, C4::Context->preference($preference_to_check)
>      : ()

Perhaps, though double function/method calls are slower. :)
Comment 9 Brendan Gallagher 2016-02-24 02:09:02 UTC
Pushed to Master - Should be in the May 2016 Release.  Thanks
Comment 10 Julian Maurice 2016-03-07 11:03:57 UTC
Patches pushed to 3.22.x, will be in 3.22.5
Comment 11 Frédéric Demians 2016-03-15 09:00:56 UTC
This patch has been pushed to 3.20.x, will be in 3.20.10.