bug 2287: use defaults when needed even if CSV has correct number of columns

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
This commit is contained in:
MJ Ray 2009-05-21 15:27:20 +01:00 committed by Henri-Damien LAURENT
parent 24749efefd
commit 858da3ea95
1 changed files with 6 additions and 0 deletions

View File

@ -143,6 +143,12 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) {
push @missing_criticals, {badparse=>1, line=>$., lineraw=>$borrowerline};
} elsif (@columns == @columnkeys) {
@borrower{@columnkeys} = @columns;
# MJR: try to fill blanks gracefully by using default values
foreach my $key (@criticals) {
if ($borrower{$key} !~ /\S/) {
$borrower{$key} = $defaults{$key};
}
}
} else {
# MJR: try to recover gracefully by using default values
foreach my $key (@columnkeys) {