Bugzilla – Attachment 39692 Details for
Bug 14115
Silence warnings t/Label*
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 14115: Silence warnings in t/Label*
PASSED-QA-Bug-14115-Silence-warnings-in-tLabel.patch (text/plain), 2.20 KB, created by
Kyle M Hall (khall)
on 2015-05-29 15:35:38 UTC
(
hide
)
Description:
[PASSED QA] Bug 14115: Silence warnings in t/Label*
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-05-29 15:35:38 UTC
Size:
2.20 KB
patch
obsolete
>From e9a71679570b8d5cc02493f0666ba223fb1a59dc Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Fri, 1 May 2015 17:56:07 -0400 >Subject: [PATCH] [PASSED QA] Bug 14115: Silence warnings in t/Label* > >Two functions were triggering noisy warnings while testing: >_get_text_fields and _split_lccn. > >TEST PLAN >---------- >1) $ prove t/Label* > -- several warnings >2) apply patch >3) $ prove t/Label* > -- no warnings >4) koha qa test tools. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Nicer, no koha-qa errors > >Signed-off-by: Aleisha <aleishaamohia@hotmail.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Labels/Label.pm | 7 ++++--- > 1 files changed, 4 insertions(+), 3 deletions(-) > >diff --git a/C4/Labels/Label.pm b/C4/Labels/Label.pm >index 83093a4..3b4318a 100644 >--- a/C4/Labels/Label.pm >+++ b/C4/Labels/Label.pm >@@ -115,7 +115,7 @@ sub _get_text_fields { > my $csv = Text::CSV_XS->new({allow_whitespace => 1}); > my $status = $csv->parse($format_string); > my @sorted_fields = map {{ 'code' => $_, desc => $_ }} >- map { $_ eq 'callnumber' ? 'itemcallnumber' : $_ } # see bug 5653 >+ map { $_ && $_ eq 'callnumber' ? 'itemcallnumber' : $_ } # see bug 5653 > $csv->fields(); > my $error = $csv->error_input(); > warn sprintf('Text field sort failed with this error: %s', $error) if $error; >@@ -129,10 +129,11 @@ sub _split_lccn { > # lccn examples: 'HE8700.7 .P6T44 1983', 'BS2545.E8 H39 1996'; > my @parts = Library::CallNumber::LC->new($lccn)->components(); > unless (scalar @parts && defined $parts[0]) { >- warn sprintf('regexp failed to match string: %s', $_); >+ $debug and warn sprintf('regexp failed to match string: %s', $_); > @parts = $_; # if no match, just use the whole string. > } >- push @parts, split /\s+/, pop @parts; # split the last piece into an arbitrary number of pieces at spaces >+ my $LastPiece = pop @parts; >+ push @parts, split /\s+/, $LastPiece if $LastPiece; # split the last piece into an arbitrary number of pieces at spaces > $debug and warn "split_lccn array: ", join(" | ", @parts), "\n"; > return @parts; > } >-- >1.7.2.5
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 14115
:
38756
|
38907
|
39432
|
39499
| 39692