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.)
Hi Marce, can you give some more information about this? How to reproduce?
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
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.
I have changed this from enhancement (which has been a default :( ) to minor, as floody logs are a royal pain!
Created attachment 28267 [details] [review] 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.
Created attachment 28268 [details] [review] 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.
See comment 5 and comment 6 for the corresponding test plans. This should make C4/Languages.pm less floody.
Created attachment 28272 [details] [review] [SIGNED-OFF] 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
Created attachment 28273 [details] [review] [SIGNED-OFF] 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
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>
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>
Pushed to master, along with a direct regression test that uses Test::Warn to check for the presence of warnings. Thanks, Mark!