From 9e82c921a6a5d43323535393d1b5006c12535eba Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 4 Nov 2016 09:19:01 +0000 Subject: [PATCH] Bug 17548: Fix step 1 of memberentry This bug has been highlighted by bug 15407. The date limit check on the category code did not work on step 1. But after bug 15407 the script crashes with Can't call method "dateofbirthrequired" on an undefined value at /home/vagrant/kohaclone/members/memberentry.pl line 311. Test plan: - Edit "step 1" information of a patron (first 'Edit' on a patron detail page). - Save => Without this patch it BOOMs => With this patch, the info should be correctly saved Signed-off-by: Josef Moravec Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall --- members/memberentry.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/members/memberentry.pl b/members/memberentry.pl index d2f462f72a..95d2af0586 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -307,7 +307,7 @@ if ($op eq 'save' || $op eq 'insert'){ if ( $newdata{dateofbirth} ) { my $age = GetAge($newdata{dateofbirth}); - my $borrowercategory = Koha::Patron::Categories->find($newdata{categorycode}); + my $borrowercategory = Koha::Patron::Categories->find($categorycode); my ($low,$high) = ($borrowercategory->dateofbirthrequired, $borrowercategory->upperagelimit); if (($high && ($age > $high)) or ($age < $low)) { push @errors, 'ERROR_age_limitations'; -- 2.39.5