View | Details | Raw Unified | Return to bug 9811
Collapse All | Expand All

(-)a/C4/Utils/DataTables/Members.pm (-1 / +8 lines)
Lines 91-97 sub search { Link Here
91
        $limit = "LIMIT $dt_params->{iDisplayStart},$dt_params->{iDisplayLength}";
91
        $limit = "LIMIT $dt_params->{iDisplayStart},$dt_params->{iDisplayLength}";
92
    }
92
    }
93
93
94
    my $query = join(" ", $select, $from, $where, $orderby, $limit);
94
    my $query = join(
95
        " ",
96
        ($select ? $select : ""),
97
        ($from ? $from : ""),
98
        ($where ? $where : ""),
99
        ($orderby ? $orderby : ""),
100
        ($limit ? $limit : "")
101
    );
95
    my $sth = $dbh->prepare($query);
102
    my $sth = $dbh->prepare($query);
96
    $sth->execute(@where_args);
103
    $sth->execute(@where_args);
97
    my $patrons = $sth->fetchall_arrayref({});
104
    my $patrons = $sth->fetchall_arrayref({});
(-)a/t/DataTables/Members.t (-1 / +14 lines)
Line 0 Link Here
0
- 
1
use Modern::Perl;
2
use Test::More tests => 4;
3
4
use_ok( "C4::Utils::DataTables::Members" );
5
6
my $patrons = C4::Utils::DataTables::Members::search({
7
    searchmember => "Doe",
8
    searchfieldstype => 'standard',
9
    searchtype => 'contains'
10
});
11
12
isnt( $patrons->{iTotalDisplayRecords}, undef, "The iTotalDisplayRecords key is defined");
13
isnt( $patrons->{iTotalRecords}, undef, "The iTotalRecords key is defined");
14
is( ref $patrons->{patrons}, 'ARRAY', "The patrons key is an arrayref");

Return to bug 9811