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

(-)a/C4/Utils/DataTables/Members.pm (-1 / +8 lines)
Lines 90-96 sub search { Link Here
90
        $limit = "LIMIT $dt_params->{iDisplayStart},$dt_params->{iDisplayLength}";
90
        $limit = "LIMIT $dt_params->{iDisplayStart},$dt_params->{iDisplayLength}";
91
    }
91
    }
92
92
93
    my $query = join(" ", $select, $from, $where, $orderby, $limit);
93
    my $query = join(
94
        " ",
95
        ($select ? $select : ""),
96
        ($from ? $from : ""),
97
        ($where ? $where : ""),
98
        ($orderby ? $orderby : ""),
99
        ($limit ? $limit : "")
100
    );
94
    my $sth = $dbh->prepare($query);
101
    my $sth = $dbh->prepare($query);
95
    $sth->execute(@where_args);
102
    $sth->execute(@where_args);
96
    my $patrons = $sth->fetchall_arrayref({});
103
    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