According to http://perldoc.perl.org/vars.html, "our" should be a reasonable substitute for the "use vars". By declaring as "our", and removing the INIT, prove t/00-load will no longer generate a warning about INIT for the C4/Barcodes/hbyymmincr.pm module. TEST PLAN --------- 1) prove t/00-load.t -- warnings about INIT for hbyymmincr 2) prove `git grep -l hbyymmincr | grep [.]t$` -- should all run okay 3) apply patch 4) repeat steps 1 and 2 -- warning should be gone, and everything else run okay 5) run koha qa test tools
Created attachment 51954 [details] [review] Bug 16635: t/00-load.t warning from C4/Barcodes/hbyymmincr.pm According to http://perldoc.perl.org/vars.html, "our" should be a reasonable substitute for the "use vars". By declaring as "our", and removing the INIT, prove t/00-load will no longer generate a warning about INIT for the C4/Barcodes/hbyymmincr.pm module. TEST PLAN --------- 1) prove t/00-load.t -- warnings about INIT for hbyymmincr 2) prove `git grep -l hbyymmincr | grep [.]t$` -- should all run okay 3) apply patch 4) repeat steps 1 and 2 -- warning should be gone, and everything else run okay 5) run koha qa test tools
Created attachment 51955 [details] [review] Bug 16635: t/00-load.t warning from C4/Barcodes/hbyymmincr.pm According to http://perldoc.perl.org/vars.html, "our" should be a reasonable substitute for the "use vars". By declaring as "our", and removing the INIT, prove t/00-load will no longer generate a warning about INIT for the C4/Barcodes/hbyymmincr.pm module. TEST PLAN --------- 1) prove t/00-load.t -- warnings about INIT for hbyymmincr 2) prove `git grep -l hbyymmincr | grep [.]t$` -- should all run okay 3) apply patch 4) repeat steps 1 and 2 -- warning should be gone, and everything else run okay 5) run koha qa test tools
Created attachment 52070 [details] [review] [SIGNED-OFF] Bug 16635: t/00-load.t warning from C4/Barcodes/hbyymmincr.pm According to http://perldoc.perl.org/vars.html, "our" should be a reasonable substitute for the "use vars". By declaring as "our", and removing the INIT, prove t/00-load will no longer generate a warning about INIT for the C4/Barcodes/hbyymmincr.pm module. TEST PLAN --------- 1) prove t/00-load.t -- warnings about INIT for hbyymmincr 2) prove `git grep -l hbyymmincr | grep [.]t$` -- should all run okay 3) apply patch 4) repeat steps 1 and 2 -- warning should be gone, and everything else run okay 5) run koha qa test tools Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
I've signed this off because it is way better than it was, but there's no reason for those vars to be our, my is quite sufficient.
Created attachment 52072 [details] [review] Bug 16635: t/00-load.t warning from C4/Barcodes/hbyymmincr.pm According to http://perldoc.perl.org/vars.html, "our" should be a reasonable substitute for the "use vars". By declaring as "our", and removing the INIT, prove t/00-load will no longer generate a warning about INIT for the C4/Barcodes/hbyymmincr.pm module. TEST PLAN --------- 1) prove t/00-load.t -- warnings about INIT for hbyymmincr 2) prove `git grep -l hbyymmincr | grep [.]t$` -- should all run okay 3) apply patch 4) repeat steps 1 and 2 -- warning should be gone, and everything else run okay 5) run koha qa test tools Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Created attachment 52073 [details] [review] Bug 16635: [QA Follow-up] Eliminate some global package vars [1] $branch is only related to line 123 as fallback. [2] $width moved to a constant; sub width is not used. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested the corresponding plugin in item editor. Test t/db_dependent/Barcodes.t and Barcodes_ValueBuilder.t still pass.
Created attachment 52074 [details] [review] Bug 16635: t/00-load.t warning from C4/Barcodes/hbyymmincr.pm According to http://perldoc.perl.org/vars.html, "our" should be a reasonable substitute for the "use vars". By declaring as "our", and removing the INIT, prove t/00-load will no longer generate a warning about INIT for the C4/Barcodes/hbyymmincr.pm module. TEST PLAN --------- 1) prove t/00-load.t -- warnings about INIT for hbyymmincr 2) prove `git grep -l hbyymmincr | grep [.]t$` -- should all run okay 3) apply patch 4) repeat steps 1 and 2 -- warning should be gone, and everything else run okay 5) run koha qa test tools Signed-off-by: Srdjan <srdjan@catalyst.net.nz> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 52075 [details] [review] Bug 16635: [QA Follow-up] Eliminate some global package vars [1] $branch is only related to line 123 as fallback. [2] $width moved to a constant; sub width is not used. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested the corresponding plugin in item editor. Test t/db_dependent/Barcodes.t and Barcodes_ValueBuilder.t still pass.
Pushed to master for Koha 16.11, thanks Mark, Marcell!
Pushed in 16.05. Will be in 16.05.01.
Patch pushed to 3.22.x, will be in 3.22.8