Bug 16635 - t/00-load.t warning from C4/Barcodes/hbyymmincr.pm
Summary: t/00-load.t warning from C4/Barcodes/hbyymmincr.pm
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial (vote)
Assignee: Mark Tompsett
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-02 00:40 UTC by Mark Tompsett
Modified: 2017-12-07 22:15 UTC (History)
5 users (show)

See Also:
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 (1.58 KB, patch)
2016-06-02 00:43 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 16635: t/00-load.t warning from C4/Barcodes/hbyymmincr.pm (1.58 KB, patch)
2016-06-02 00:46 UTC, Mark Tompsett
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 16635: t/00-load.t warning from C4/Barcodes/hbyymmincr.pm (1.62 KB, patch)
2016-06-06 05:33 UTC, Srdjan Jankovic
Details | Diff | Splinter Review
Bug 16635: t/00-load.t warning from C4/Barcodes/hbyymmincr.pm (1.67 KB, patch)
2016-06-06 09:07 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 16635: [QA Follow-up] Eliminate some global package vars (3.18 KB, patch)
2016-06-06 09:07 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 16635: t/00-load.t warning from C4/Barcodes/hbyymmincr.pm (1.72 KB, patch)
2016-06-06 09:09 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 16635: [QA Follow-up] Eliminate some global package vars (3.18 KB, patch)
2016-06-06 09:09 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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