Bug 40380: Remove warnings from Patrons/Import.t - Use of uninitialized value $csvkeycol{"dateexpiry"} in array element

Use of uninitialized value $csvkeycol{"dateexpiry"} in array element at /kohadevbox/koha/Koha/Patrons/Import.pm line 310, <$handle_2> line 2.
Use of uninitialized value $csvkeycol{"dateexpiry"} in array element at /kohadevbox/koha/Koha/Patrons/Import.pm line 310, <$handle_3> line 2.
Use of uninitialized value $csvkeycol{"dateexpiry"} in array element at /kohadevbox/koha/Koha/Patrons/Import.pm line 310, <$handle_4> line 2.
Use of uninitialized value $csvkeycol{"dateexpiry"} in array element at /kohadevbox/koha/Koha/Patrons/Import.pm line 310, <$fh> line 2.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e21d6c04a9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Jonathan Druart 2025-07-15 13:43:18 +02:00 committed by Paul Derscheid
parent 686495ae04
commit 88ae9b2c1f
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 2 additions and 1 deletions

View File

@ -307,7 +307,8 @@ LINE: while ( my $borrowerline = <$handle> ) {
next if $col eq 'password' && !$overwrite_passwords;
next if $col eq 'dateexpiry' && $update_dateexpiry;
$borrower{$col} = $member->{$col} if $col eq 'dateexpiry' && !$columns[ $csvkeycol{$col} ];
$borrower{$col} = $member->{$col}
if $col eq 'dateexpiry' && ( !$csvkeycol{$col} || !$columns[ $csvkeycol{$col} ] );
unless ( exists( $csvkeycol{$col} ) || $defaults->{$col} ) {
$borrower{$col} = $member->{$col} if ( $member->{$col} );