The warnings are triggered by a lack of opachtdocs, as the current mock function returns '', cascading C4::Template::themelanguage to fall through with no explicit return (turns out to be treated like '',undef,undef). This in turn sets the preferredtheme and lang to undef, which triggers the use of uninitialized values warning. While trying to figure out the best way to fix this, bug 8846 was discovered. Attempting to unset $KOHA_CONF triggers warnings, because of the "use C4::Context;" in C4::Languages and C4::Templates. prove t/db_dependent/SuggestionEngine_ExplodedTerms.t can reproduce the noise easily.
Created attachment 53160 [details] [review] Bug 16869: Silence and catch warnings in t/db_dependent/SuggestionEngine_ExplodedTerms.t By properly defining a opachtdocs (intranethtdocs was done too) in the mock function, uninitialized variable warnings are eliminated. Given that we can check if $KOHA_CONF is defined or not, we can catch the warning as part of testing, so the output of the test is cleaner. TEST PLAN --------- 1) unset KOHA_CONF 2) prove t/db_dependent/SuggestionEngine_ExplodedTerms.t -- lots of noise 3) apply patch 4) prove t/db_dependent/SuggestionEngine_ExplodedTerms.t -- no noise 5) prove -v t/db_dependent/SuggestionEngine_ExplodedTerms.t -- see the warnings were caught and not just ignored. 6) run koha qa test tools
Created attachment 53168 [details] [review] [SIGNED-OFF]Bug 16869: Silence and catch warnings in t/db_dependent/SuggestionEngine_ExplodedTerms.t By properly defining a opachtdocs (intranethtdocs was done too) in the mock function, uninitialized variable warnings are eliminated. Given that we can check if $KOHA_CONF is defined or not, we can catch the warning as part of testing, so the output of the test is cleaner. TEST PLAN --------- 1) unset KOHA_CONF 2) prove t/db_dependent/SuggestionEngine_ExplodedTerms.t -- lots of noise 3) apply patch 4) prove t/db_dependent/SuggestionEngine_ExplodedTerms.t -- no noise 5) prove -v t/db_dependent/SuggestionEngine_ExplodedTerms.t -- see the warnings were caught and not just ignored. 6) run koha qa test tools Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> No warnings. Works as advertised
Created attachment 53169 [details] [review] Bug 16869: Silence and catch warnings in t/db_dependent/SuggestionEngine_ExplodedTerms.t By properly defining a opachtdocs (intranethtdocs was done too) in the mock function, uninitialized variable warnings are eliminated. Given that we can check if $KOHA_CONF is defined or not, we can catch the warning as part of testing, so the output of the test is cleaner. TEST PLAN --------- 1) unset KOHA_CONF 2) prove t/db_dependent/SuggestionEngine_ExplodedTerms.t -- lots of noise 3) apply patch 4) prove t/db_dependent/SuggestionEngine_ExplodedTerms.t -- no noise 5) prove -v t/db_dependent/SuggestionEngine_ExplodedTerms.t -- see the warnings were caught and not just ignored. 6) run koha qa test tools Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> No warnings. Works as advertised Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master for 16.11, thanks Mark!
Pushed in 16.05. Will be in 16.05.02.
Patch pushed to 3.22.x, will be in 3.22.10