Bug 7841 - Several warnings on language from webinstaller
Summary: Several warnings on language from webinstaller
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:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-28 13:56 UTC by Marcel de Rooy
Modified: 2014-12-07 20:07 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 7841 - Tests to detect no changes (1.83 KB, patch)
2014-05-15 03:58 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 7841 - Tweaks to remove floody messages from tests. (2.75 KB, patch)
2014-05-15 03:59 UTC, Mark Tompsett
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 7841 - Tests to detect no changes (1.93 KB, patch)
2014-05-15 11:08 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 7841: Tweaks to remove floody messages from tests. (2.87 KB, patch)
2014-05-15 11:08 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[PASSED QA] Bug 7841 - Tests to detect no changes (1.99 KB, patch)
2014-05-16 11:16 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
[PASSED QA] Bug 7841: Tweaks to remove floody messages from tests. (2.92 KB, patch)
2014-05-16 11:17 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2012-03-28 13:56:15 UTC
To be resolved warnings like:

[Wed Mar 28 15:45:24 2012] [error] [client 82.173.53.17] [Wed Mar 28 15:45:24 2012] install.pl: Use of uninitialized value $string in pattern match (m//) at /usr/share/koha/testclone/C4/Languages.pm line 424.

[Wed Mar 28 15:45:24 2012] [error] [client 82.173.53.17] [Wed Mar 28 15:45:24 2012] install.pl: Use of uninitialized value $current_language in string eq at /usr/share/koha/testclone/C4/Languages.pm line 301.

[Wed Mar 28 15:45:24 2012] [error] [client 82.173.53.17] [Wed Mar 28 15:45:24 2012] install.pl: Use of uninitialized value in string eq at /usr/share/koha/testclone/C4/Languages.pm line 319.

(Occurring several times in the log.)
Comment 1 Katrin Fischer 2013-04-14 09:40:02 UTC
Hi Marce, can you give some more information about this? How to reproduce?
Comment 2 Marcel de Rooy 2013-04-15 06:53:25 UTC
Goto staff client.
Instead of logging in, goto webinstaller via /cgi-bin/koha/installer/install.pl?step=3&op=updatestructure

This directly produces a bunch of warnings (10 for this one attempt?) in the staff log like:
install.pl: Use of uninitialized value $string in pattern match (m//) at /usr/share/koha/testclone/C4/Languages.pm line 439
OR
Use of uninitialized value $current_language in string eq at /usr/share/koha/testclone/C4/Languages.pm line 316
OR
Use of uninitialized value in string eq at /usr/share/koha/testclone/C4/Languages.pm line 334
Comment 3 Mark Tompsett 2014-05-15 03:57:09 UTC
I have added tests into t/db_dependent/Languages.t which should trigger these same messages.

I have then corrected C4/Languages.pm accordingly.

If anyone thinks this is lacking, let me know.
Comment 4 Mark Tompsett 2014-05-15 03:58:15 UTC
I have changed this from enhancement (which has been a default :( ) to minor, as floody logs are a royal pain!
Comment 5 Mark Tompsett 2014-05-15 03:58:54 UTC Comment hidden (obsolete)
Comment 6 Mark Tompsett 2014-05-15 03:59:09 UTC Comment hidden (obsolete)
Comment 7 Mark Tompsett 2014-05-15 04:18:23 UTC
See comment 5 and comment 6 for the corresponding test plans. This should make C4/Languages.pm less floody.
Comment 8 Bernardo Gonzalez Kriegel 2014-05-15 11:08:16 UTC Comment hidden (obsolete)
Comment 9 Bernardo Gonzalez Kriegel 2014-05-15 11:08:25 UTC Comment hidden (obsolete)
Comment 10 Kyle M Hall (khall) 2014-05-16 11:16:49 UTC
Created attachment 28292 [details] [review]
[PASSED QA] Bug 7841 - Tests to detect no changes

When called with undef, floody messages appear in the error
logs. Less floody messages appear when using 'en' as the
language.

TEST PLAN
---------
1) apply the patch
2) prove -v t/db_dependent/Languages.t
   -- All the tests should pass, including the last two which
      a) check that when undef is used no language is marked
          as current.
      b) check that when 'en' is used there is a language marked
          as current.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Test pass, no koha-qa errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 11 Kyle M Hall (khall) 2014-05-16 11:17:03 UTC
Created attachment 28293 [details] [review]
[PASSED QA] Bug 7841: Tweaks to remove floody messages from tests.

This modifies lines in C4/Languages.pm such that when the tests
are run, they no longer generate errors.

TEST PLAN
---------
1) Apply first patch
2) prove -v t/db_dependent/Languages.t
   -- There will be uninitialized string messages, etc.
3) Apply second patch (this one)
4) prove -v t/db_dependent/Languages.t
   -- Only one carp message will remain.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Test pass, no warnings, no koha-qa errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 12 Galen Charlton 2014-05-19 16:44:05 UTC
Pushed to master, along with a direct regression test that uses Test::Warn to check for the presence of warnings.

Thanks, Mark!