Bug 7841

Summary: Several warnings on language from webinstaller
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Installation and upgrade (web-based installer)Assignee: Mark Tompsett <mtompset>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P5 - low CC: bgkriegel, gmcharlt, katrin.fischer, mtompset
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 7841 - Tests to detect no changes
Bug 7841 - Tweaks to remove floody messages from tests.
[SIGNED-OFF] Bug 7841 - Tests to detect no changes
[SIGNED-OFF] Bug 7841: Tweaks to remove floody messages from tests.
[PASSED QA] Bug 7841 - Tests to detect no changes
[PASSED QA] Bug 7841: Tweaks to remove floody messages from tests.

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 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 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!