Bug 14115

Summary: Silence warnings t/Label*
Product: Koha Reporter: Mark Tompsett <mtompset>
Component: Test SuiteAssignee: Mark Tompsett <mtompset>
Status: CLOSED FIXED QA Contact: Galen Charlton <gmcharlt>
Severity: minor    
Priority: P5 - low CC: bgkriegel, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 8879    
Attachments: Bug 14115: Silence warnings in t/Label*
[SIGNED-OFF] Bug 14115: Silence warnings in t/Label*
Bug 14115: Silence warnings in t/Label*
Bug 14115: Silence warnings in t/Label*
[PASSED QA] Bug 14115: Silence warnings in t/Label*

Description Mark Tompsett 2015-05-01 21:55:24 UTC
Various uninitialized warnings spew out when proving. Clean up output while maintaining test integrity.
Comment 1 Mark Tompsett 2015-05-01 22:01:27 UTC Comment hidden (obsolete)
Comment 2 Bernardo Gonzalez Kriegel 2015-05-06 20:15:45 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2015-05-22 08:33:37 UTC
Comment on attachment 38907 [details] [review]
[SIGNED-OFF] Bug 14115: Silence warnings in t/Label*

Review of attachment 38907 [details] [review]:
-----------------------------------------------------------------

::: C4/Labels/Label.pm
@@ +115,5 @@
>      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

I am not against cutting lines, but this should be done to improve the readability.
Here you didn't, there are 2 map, and 1 is cut after a ?

Perltidy suggests me:

117     my @sorted_fields = map { { 'code' => $_, desc => $_ } }
118       map { $_ && $_ eq 'callnumber' ? 'itemcallnumber' : $_ }    # see bug 5653
119       $csv->fields();
Comment 4 Mark Tompsett 2015-05-22 17:36:58 UTC Comment hidden (obsolete)
Comment 5 Aleisha Amohia 2015-05-26 05:23:36 UTC Comment hidden (obsolete)
Comment 6 Kyle M Hall 2015-05-29 15:35:38 UTC
Created attachment 39692 [details] [review]
[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>
Comment 7 Tomás Cohen Arazi 2015-06-01 17:19:33 UTC
Patch pushed to master.

Thanks Mark!