From ec8ca853a648a79afe3c466dc9a5b812e4926980 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 --- 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 5a019f4c1b..777c659747 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -58,10 +58,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