From 673f0a25e53d665f4dfaf86982050080a0ab8a8d Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Mon, 10 Dec 2007 17:04:39 -0600 Subject: [PATCH] moremember.pl - We will be doing a lot of debugging on Members, this is just the beginning. Signed-off-by: Joshua Ferraro --- members/moremember.pl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/members/moremember.pl b/members/moremember.pl index 34f55bb8d5..64d8083a52 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -46,6 +46,12 @@ use C4::Biblio; use C4::Reserves; use C4::Branch; # GetBranchName +use vars qw($debug); + +BEGIN { + $debug = $ENV{DEBUG} || 0; +} + my $dbh = C4::Context->dbh; my $input = new CGI; @@ -94,8 +100,14 @@ my $category_type = $borrowercategory->{'category_type'}; $template->param( $data->{'categorycode'} => 1 ); foreach (qw(dateenrolled dateexpiry dateofbirth)) { - my $tempdate = C4::Dates->new($data->{$_},'iso')->output('syspref') - or warn ("Invalid $_ = " . $data->{$_}); + my $userdate = $data->{$_}; + unless ($userdate) { + $debug and warn sprintf "Empty \$data{%12s}", $_; + $data->{$_} = ''; + next; + } + my $tempdate = C4::Dates->new($userdate,'iso')->output('syspref') + or warn ("Invalid $_ = '$userdate'"); $data->{$_} = $tempdate || ''; } $data->{'IS_ADULT'} = ( $data->{'categorycode'} ne 'I' ); -- 2.39.5