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

(-)a/C4/Members.pm (-2 / +4 lines)
Lines 428-435 sub GetBorrowersToExpunge { Link Here
428
        if (ref($filtercategory) ne 'ARRAY' ) {
428
        if (ref($filtercategory) ne 'ARRAY' ) {
429
            $filtercategory = [ $filtercategory ];
429
            $filtercategory = [ $filtercategory ];
430
        }
430
        }
431
        $query .= " AND categorycode IN (" . join(',', ('?') x @$filtercategory) . ") ";
431
        if ( @$filtercategory ) {
432
        push( @query_params, @$filtercategory );
432
            $query .= " AND categorycode IN (" . join(',', ('?') x @$filtercategory) . ") ";
433
            push( @query_params, @$filtercategory );
434
        }
433
    }
435
    }
434
    if ( $filterpatronlist ){
436
    if ( $filterpatronlist ){
435
        $query.=" AND patron_list_id = ? ";
437
        $query.=" AND patron_list_id = ? ";
(-)a/t/db_dependent/Members.t (-2 / +3 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 53;
20
use Test::More tests => 54;
21
use Test::MockModule;
21
use Test::MockModule;
22
use Test::Exception;
22
use Test::Exception;
23
23
Lines 303-308 $patstodel = GetBorrowersToExpunge( {branchcode => $library3->{branchcode},patro Link Here
303
is( scalar(@$patstodel),1,'Borrower with issue not deleted by branchcode and list');
303
is( scalar(@$patstodel),1,'Borrower with issue not deleted by branchcode and list');
304
$patstodel = GetBorrowersToExpunge( {category_code => 'CIVILIAN',patron_list_id => $list1->patron_list_id() } );
304
$patstodel = GetBorrowersToExpunge( {category_code => 'CIVILIAN',patron_list_id => $list1->patron_list_id() } );
305
is( scalar(@$patstodel),1,'Borrower with issue not deleted by category_code and list');
305
is( scalar(@$patstodel),1,'Borrower with issue not deleted by category_code and list');
306
$patstodel = GetBorrowersToExpunge( {category_code => [], patron_list_id => $list1->patron_list_id() } );
307
is( scalar(@$patstodel),1,'category_code can contain an empty arrayref');
306
$patstodel = GetBorrowersToExpunge( {category_code => ['CIVILIAN','STAFFER'],patron_list_id => $list1->patron_list_id() } );
308
$patstodel = GetBorrowersToExpunge( {category_code => ['CIVILIAN','STAFFER'],patron_list_id => $list1->patron_list_id() } );
307
is( scalar(@$patstodel),1,'Borrower with issue not deleted by multiple category_code and list');
309
is( scalar(@$patstodel),1,'Borrower with issue not deleted by multiple category_code and list');
308
$patstodel = GetBorrowersToExpunge( {expired_before => '2015-01-02',patron_list_id => $list1->patron_list_id() } );
310
$patstodel = GetBorrowersToExpunge( {expired_before => '2015-01-02',patron_list_id => $list1->patron_list_id() } );
309
- 

Return to bug 28001