From 03903fea256f03542d8a7209fb841de3a6f35392 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Wed, 18 Mar 2009 17:21:49 -0500 Subject: [PATCH] Invalid field 'expiry' referenced. This caused a warning from C4::Dates on every execution, since the value passed to format_date was undefined. Now we reference the correct field and check for a populated value before trying to reformat it. Signed-off-by: Galen Charlton Signed-off-by: Henri-Damien LAURENT --- opac/opac-user.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 7d56b040cb..528c2e0acb 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -57,10 +57,10 @@ my $patronupdate = $query->param('patronupdate'); # get borrower information .... my ( $borr ) = GetMemberDetails( $borrowernumber ); -$borr->{'dateenrolled'} = format_date( $borr->{'dateenrolled'} ); -$borr->{'expiry'} = format_date( $borr->{'expiry'} ); -$borr->{'dateofbirth'} = format_date( $borr->{'dateofbirth'} ); -$borr->{'ethnicity'} = fixEthnicity( $borr->{'ethnicity'} ); +for (qw(dateenrolled dateexpiry dateofbirth)) { + ($borr->{$_}) and $borr->{$_} = format_date($borr->{$_}); +} +$borr->{'ethnicity'} = fixEthnicity( $borr->{'ethnicity'} ); if ( $borr->{'debarred'} || $borr->{'gonenoaddress'} || $borr->{'lost'} ) { $borr->{'flagged'} = 1; -- 2.39.5