From 849f9c9c9579625f6f36abf294bd96eb42d6a694 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 21 Apr 2015 16:50:12 +0200 Subject: [PATCH] Bug 12633: Fix specific default values The dates should be set to undef if defined but empty, otherwise with an empty string, '0000-00-00' will be inserted into the DB. Signed-off-by: Mirko Tietgen --- C4/Members.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/C4/Members.pm b/C4/Members.pm index 433b361..42a56a1 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -670,6 +670,9 @@ sub ModMember { my $new_borrower = { map { join(' ', @columns) =~ /$_/ ? ( $_ => $data{$_} ) : () } keys(%data) }; delete $new_borrower->{flags}; + $new_borrower->{dateofbirth} ||= undef if exists $new_borrower->{dateofbirth}; + $new_borrower->{dateenrolled} ||= undef if exists $new_borrower->{dateenrolled}; + $new_borrower->{dateexpiry} ||= undef if exists $new_borrower->{dateexpiry}; my $rs = $schema->resultset('Borrower')->search({ borrowernumber => $new_borrower->{borrowernumber}, }); -- 1.7.10.4