Bug 12598: Remove warnings from tests and make them pass

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2018-01-04 10:05:46 -03:00
parent 29e4291718
commit bd122369dc
2 changed files with 2 additions and 3 deletions

View File

@ -167,7 +167,7 @@ sub import_patrons {
if ( defined($matchpoint) && ( $matchpoint eq 'cardnumber' ) && ( $borrower{'cardnumber'} ) ) {
$member = Koha::Patrons->find( { cardnumber => $borrower{'cardnumber'} } );
}
elsif ( ($matchpoint eq 'userid') && ($borrower{'userid'}) ) {
elsif ( defined($matchpoint) && ($matchpoint eq 'userid') && ($borrower{'userid'}) ) {
$member = Koha::Patrons->find( { userid => $borrower{userid} } );
}
elsif ($extended) {
@ -201,7 +201,7 @@ sub import_patrons {
}
# Check if the userid provided does not exist yet
if ( $matchpoint ne 'userid' and exists $borrower{userid}
if ( defined($matchpoint) and $matchpoint ne 'userid' and exists $borrower{userid}
and $borrower{userid}
and not Check_Userid( $borrower{userid}, $borrower{borrowernumber} ) ) {
push @errors, { duplicate_userid => 1, userid => $borrower{userid} };

View File

@ -317,7 +317,6 @@ subtest 'test_prepare_columns' => sub {
plan tests => 16;
# Given ... no header row
my $headerrow_0;
my %csvkeycol_0;
my @errors_0;