Bug 16635

Summary: t/00-load.t warning from C4/Barcodes/hbyymmincr.pm
Product: Koha Reporter: Mark Tompsett <mtompset>
Component: Test SuiteAssignee: Mark Tompsett <mtompset>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: trivial    
Priority: P5 - low CC: f.demians, julian.maurice, kyle, m.de.rooy, srdjan
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14110
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 16635: t/00-load.t warning from C4/Barcodes/hbyymmincr.pm
Bug 16635: t/00-load.t warning from C4/Barcodes/hbyymmincr.pm
[SIGNED-OFF] Bug 16635: t/00-load.t warning from C4/Barcodes/hbyymmincr.pm
Bug 16635: t/00-load.t warning from C4/Barcodes/hbyymmincr.pm
Bug 16635: [QA Follow-up] Eliminate some global package vars
Bug 16635: t/00-load.t warning from C4/Barcodes/hbyymmincr.pm
Bug 16635: [QA Follow-up] Eliminate some global package vars

Description Mark Tompsett 2016-06-02 00:40:58 UTC
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
Comment 1 Mark Tompsett 2016-06-02 00:43:10 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2016-06-02 00:46:09 UTC Comment hidden (obsolete)
Comment 3 Srdjan Jankovic 2016-06-06 05:33:13 UTC Comment hidden (obsolete)
Comment 4 Srdjan Jankovic 2016-06-06 05:34:53 UTC
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.
Comment 5 Marcel de Rooy 2016-06-06 09:07:23 UTC Comment hidden (obsolete)
Comment 6 Marcel de Rooy 2016-06-06 09:07:27 UTC Comment hidden (obsolete)
Comment 7 Marcel de Rooy 2016-06-06 09:09:18 UTC
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>
Comment 8 Marcel de Rooy 2016-06-06 09:09:22 UTC
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.
Comment 9 Kyle M Hall 2016-06-10 17:59:15 UTC
Pushed to master for Koha 16.11, thanks Mark, Marcell!
Comment 10 Frédéric Demians 2016-06-15 07:50:46 UTC
Pushed in 16.05. Will be in 16.05.01.
Comment 11 Julian Maurice 2016-06-16 10:04:07 UTC
Patch pushed to 3.22.x, will be in 3.22.8