[Koha-patches] [PATCH] Invalid field 'expiry' referenced.

Joe Atzberger joe.atzberger at liblime.com
Wed Mar 18 23:21:49 CET 2009


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.
---
 opac/opac-user.pl |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/opac/opac-user.pl b/opac/opac-user.pl
index 8d89dda..49d0873 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;
-- 
1.5.6.5




More information about the Koha-patches mailing list