Browse Source

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 <josef.moravec@gmail.com>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
16.11.x
Jonathan Druart 8 years ago
committed by Kyle M Hall
parent
commit
9e82c921a6
  1. 2
      members/memberentry.pl

2
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';

Loading…
Cancel
Save