From 69e4b9b69b81dc35636cacad1f4dfb7042636cfc 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 Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- C4/Members.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/C4/Members.pm b/C4/Members.pm index 81e83ace83..c5e5453e50 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}, }); -- 2.39.5