Bugzilla – Attachment 136067 Details for
Bug 30409
barcodedecode() should always trim barcode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30409: (QA follow-up) Avoid uninitialized variable warnings
Bug-30409-QA-follow-up-Avoid-uninitialized-variabl.patch (text/plain), 1.54 KB, created by
Tomás Cohen Arazi
on 2022-06-14 11:26:39 UTC
(
hide
)
Description:
Bug 30409: (QA follow-up) Avoid uninitialized variable warnings
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2022-06-14 11:26:39 UTC
Size:
1.54 KB
patch
obsolete
>From 1b336bf4cc269c91915c41399dc9dadf04535cef Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 14 Jun 2022 08:21:42 -0300 >Subject: [PATCH] Bug 30409: (QA follow-up) Avoid uninitialized variable > warnings > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > C4/Circulation.pm | 3 +++ > t/Circulation_barcodedecode.t | 8 +++++++- > 2 files changed, 10 insertions(+), 1 deletion(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index b1de4908ba..f5df973d1d 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -167,6 +167,9 @@ System Pref options. > # > sub barcodedecode { > my ($barcode, $filter) = @_; >+ >+ return unless defined $barcode; >+ > my $branch = C4::Context::mybranch(); > $barcode =~ s/^\s+|\s+$//g; > $filter = C4::Context->preference('itemBarcodeInputFilter') unless $filter; >diff --git a/t/Circulation_barcodedecode.t b/t/Circulation_barcodedecode.t >index 094d4aafc5..d5f31c9533 100755 >--- a/t/Circulation_barcodedecode.t >+++ b/t/Circulation_barcodedecode.t >@@ -17,7 +17,8 @@ > > use Modern::Perl; > >-use Test::More tests => 28; >+use Test::More tests => 29; >+use Test::Warn; > > use C4::Context; > use t::lib::Mocks; >@@ -55,6 +56,11 @@ foreach my $filter (@filters) { > } > } > >+warnings_are >+ { C4::Circulation::barcodedecode(undef); } >+ [], >+ 'No warnings with undef barcode'; >+ > # T-prefix style is derived from zero-padded "Follett Classic Code 3 of 9". From: > # www.fsc.follett.com/_file/File/pdf/Barcode%20Symbology%20Q%20%20A%203_05.pdf > # ~ 1 to 7 characters >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30409
:
132693
|
132781
|
132881
|
132884
|
132885
|
135258
|
135448
|
135453
|
135705
|
135731
|
135961
|
135962
| 136067