From 995f574841ab8112c48587fa3837d708b24b5231 Mon Sep 17 00:00:00 2001 From: D Ruth Bavousett Date: Mon, 9 Jul 2012 10:18:03 -0400 Subject: [PATCH] Bug 8392: Category age ranges not being enforced MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch works around the redefinition of an array that was causing the enforcement of age ranges to not-happen. Signed-off-by: Frédéric Demians I can confirm the bug and the solution. Signed-off-by: Chris Cormack --- members/memberentry.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/members/memberentry.pl b/members/memberentry.pl index c8a6be190f..c58abc2a23 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -101,6 +101,8 @@ my @field_check=split(/\|/,$check_BorrowerMandatoryField); foreach (@field_check) { $template->param( "mandatory$_" => 1); } +# we'll need this, later. +my $dateofbirthmandatory = (scalar grep {$_ eq "dateofbirth"} @field_check) ? 1 : 0; # function to designate unwanted fields my $check_BorrowerUnwantedField=C4::Context->preference("BorrowerUnwantedField"); @field_check=split(/\|/,$check_BorrowerUnwantedField); @@ -264,7 +266,6 @@ if ($op eq 'save' || $op eq 'insert'){ if (checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){ push @errors, 'ERROR_cardnumber'; } - my $dateofbirthmandatory = (scalar grep {$_ eq "dateofbirth"} @field_check) ? 1 : 0; if ($newdata{dateofbirth} && $dateofbirthmandatory) { my $age = GetAge($newdata{dateofbirth}); my $borrowercategory=GetBorrowercategory($newdata{'categorycode'}); -- 2.39.5