[Koha-patches] [PATCH 3/3] Bug 17933: Do not instanciate a patron if not needed

Dobrica Pavlinusic dpavlin at rot13.org
Wed Feb 1 13:50:10 CET 2017


From: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

Signed-off-by: Dobrica Pavlinusic <dpavlin at rot13.org>
---
 members/moremember.pl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/members/moremember.pl b/members/moremember.pl
index 51012ed..b3e8d76 100755
--- a/members/moremember.pl
+++ b/members/moremember.pl
@@ -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
-- 
2.1.4



More information about the Koha-patches mailing list