Bug 15719 - Silence warning in C4/Language.pm during web install
Summary: Silence warning in C4/Language.pm during web install
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (web-based installer) (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Mark Tompsett
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-01 23:37 UTC by Mark Tompsett
Modified: 2017-06-14 22:11 UTC (History)
6 users (show)

See Also:
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 (1.69 KB, patch)
2016-02-01 23:41 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 15719: Silence warning in C4/Language.pm during web install (1.46 KB, patch)
2016-02-01 23:41 UTC, Mark Tompsett
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 15719: Silence warning in C4/Language.pm during web install (1.80 KB, patch)
2016-02-08 16:40 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 15719: Silence warning in C4/Language.pm during web install (1.57 KB, patch)
2016-02-08 16:40 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 15719: Silence warning in C4/Language.pm during web install - tests (1.87 KB, patch)
2016-02-09 12:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15719: Silence warning in C4/Language.pm during web install (1.63 KB, patch)
2016-02-09 12:36 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.