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

(-)a/Koha/Patrons/Import.pm (-2 / +2 lines)
Lines 167-173 sub import_patrons { Link Here
167
        if ( defined($matchpoint) && ( $matchpoint eq 'cardnumber' ) && ( $borrower{'cardnumber'} ) ) {
167
        if ( defined($matchpoint) && ( $matchpoint eq 'cardnumber' ) && ( $borrower{'cardnumber'} ) ) {
168
            $member = Koha::Patrons->find( { cardnumber => $borrower{'cardnumber'} } );
168
            $member = Koha::Patrons->find( { cardnumber => $borrower{'cardnumber'} } );
169
        }
169
        }
170
        elsif ( ($matchpoint eq 'userid') && ($borrower{'userid'}) ) {
170
        elsif ( defined($matchpoint) && ($matchpoint eq 'userid') && ($borrower{'userid'}) ) {
171
            $member = Koha::Patrons->find( { userid => $borrower{userid} } );
171
            $member = Koha::Patrons->find( { userid => $borrower{userid} } );
172
        }
172
        }
173
        elsif ($extended) {
173
        elsif ($extended) {
Lines 201-207 sub import_patrons { Link Here
201
        }
201
        }
202
202
203
        # Check if the userid provided does not exist yet
203
        # Check if the userid provided does not exist yet
204
        if (  $matchpoint ne 'userid' and exists $borrower{userid}
204
        if ( defined($matchpoint) and $matchpoint ne 'userid' and exists $borrower{userid}
205
                 and $borrower{userid}
205
                 and $borrower{userid}
206
             and not Check_Userid( $borrower{userid}, $borrower{borrowernumber} ) ) {
206
             and not Check_Userid( $borrower{userid}, $borrower{borrowernumber} ) ) {
207
             push @errors, { duplicate_userid => 1, userid => $borrower{userid} };
207
             push @errors, { duplicate_userid => 1, userid => $borrower{userid} };
(-)a/t/db_dependent/Koha/Patrons/Import.t (-2 lines)
Lines 317-323 subtest 'test_prepare_columns' => sub { Link Here
317
    plan tests => 16;
317
    plan tests => 16;
318
318
319
    # Given ... no header row
319
    # Given ... no header row
320
    my $headerrow_0;
321
    my %csvkeycol_0;
320
    my %csvkeycol_0;
322
    my @errors_0;
321
    my @errors_0;
323
322
324
- 

Return to bug 12598