Bug 14118

Summary: Silence warnings t/DataTables/Members.t
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: jonathan.druart, tomascohen
Version: master   
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 14118: Silence warnings t/DataTables/Members.t
[SIGNED-OFF] Bug 14118: Silence warnings t/DataTables/Members.t
Bug 14118: Silence warnings t/DataTables/Members.t
[COUNTER-PATCH] Bug 14118: Prevent to save a letter if an error occurred

Description Mark Tompsett 2015-05-02 02:11:24 UTC
A couple uninitialized variable warnings when a prove -r t is issued.
Comment 1 Mark Tompsett 2015-05-02 02:12:22 UTC
I know that bug 8879 is just "prove ./t", but I think it is reasonable to extend that omnibus to include "prove -r ./t".
Comment 2 Mark Tompsett 2015-05-02 02:41:56 UTC Comment hidden (obsolete)
Comment 3 Bernardo Gonzalez Kriegel 2015-05-15 22:27:33 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2015-05-22 09:36:57 UTC
Comment on attachment 39229 [details] [review]
[SIGNED-OFF] Bug 14118: Silence warnings t/DataTables/Members.t

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

Not blocker.

::: C4/Utils/DataTables/Members.pm
@@ +103,4 @@
>  
>      my $limit;
>      # If iDisplayLength == -1, we want to display all patrons
> +    if ( !$dt_params->{iDisplayLength} || $dt_params->{iDisplayLength} > -1 ) {

What about
    if ( not $dt_params->{iDisplayLength} or $dt_params->{iDisplayLength} > -1 ) {

@@ +107,3 @@
>          # In order to avoid sql injection
> +        $dt_params->{iDisplayStart} =~ s/\D//g if defined($dt_params->{iDisplayStart});
> +        $dt_params->{iDisplayLength} =~ s/\D//g if defined($dt_params->{iDisplayLength});

useless use of parenthesis.
Comment 5 Jonathan Druart 2015-05-22 09:37:20 UTC
Created attachment 39386 [details] [review]
Bug 14118: Silence warnings t/DataTables/Members.t

After cleaning 'prove t' up. 'prove -r t' was attempted next.
A couple uninitialized variable warning were triggered.

TEST PLAN
----------
1) prove t/DataTables/Members.t
   -- warnings.
2) apply patch
3) prove t/DataTables/Members.t
   -- no warnings.
4) koha qa test tools.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Cleaned. No errors

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Comment 6 Jonathan Druart 2015-05-22 10:01:32 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2015-05-22 10:02:36 UTC
Erk, wrong bug report. Sorry about that.
Comment 8 Tomás Cohen Arazi 2015-05-22 14:19:26 UTC
Patch pushed to master.

Thanks Mark!