Bug 17933: Do not instanciate a patron if not needed
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 19 Jan 2017 10:20:33 +0000 (11:20 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 17 Feb 2017 11:22:09 +0000 (11:22 +0000)
Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
members/moremember.pl

index 51012ed..b3e8d76 100755 (executable)
@@ -242,7 +242,9 @@ my $overdues_exist = 0;
 my $totalprice = 0;
 
 # Calculate and display patron's age
-$template->param( age => Koha::Patron->new({ dateofbirth => $data->{dateofbirth} })->get_age );
+if ( $data->{dateofbirth} ) {
+    $template->param( age => Koha::Patron->new({ dateofbirth => $data->{dateofbirth} })->get_age );
+}
 
 ### ###############################################################################
 # BUILD HTML