From 5c7ac4047c0d67fd5a68177700bd6d31211dca09 Mon Sep 17 00:00:00 2001 From: MJ Ray Date: Thu, 21 May 2009 15:27:20 +0100 Subject: [PATCH] bug 2287: use defaults when needed even if CSV has correct number of columns Signed-off-by: Galen Charlton --- tools/import_borrowers.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/import_borrowers.pl b/tools/import_borrowers.pl index 9738f19dc3..5d477ef230 100755 --- a/tools/import_borrowers.pl +++ b/tools/import_borrowers.pl @@ -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) { -- 2.39.5