Invalid field 'expiry' referenced.
authorJoe Atzberger <joe.atzberger@liblime.com>
Wed, 18 Mar 2009 22:21:49 +0000 (17:21 -0500)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Tue, 26 May 2009 19:15:03 +0000 (21:15 +0200)
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 <galen.charlton@liblime.com>
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
opac/opac-user.pl

index 7d56b04..528c2e0 100755 (executable)
@@ -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;