Bugzilla – Attachment 39499 Details for
Bug 14115
Silence warnings t/Label*
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14115: Silence warnings in t/Label*
Bug-14115-Silence-warnings-in-tLabel.patch (text/plain), 2.14 KB, created by
Aleisha Amohia
on 2015-05-26 05:23:36 UTC
(
hide
)
Description:
Bug 14115: Silence warnings in t/Label*
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2015-05-26 05:23:36 UTC
Size:
2.14 KB
patch
obsolete
>From 6b582fe03fe62fc3fe2f487aaa2a0111c756875c Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Fri, 1 May 2015 17:56:07 -0400 >Subject: [PATCH] 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> >--- > C4/Labels/Label.pm | 7 ++++--- > 1 file 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.10.4
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