From 2b6a845c31582e5178a72efc156e6d925eff0b8f Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Wed, 9 Sep 2020 13:54:34 +0200 Subject: [PATCH] Bug 26417: Remove warn in Koha::Patron is_valid_age In Koha::Patron is_valid_age the is a compare : $age < $low But $low may be undef. It generates a warn : Use of uninitialized value $low in numeric lt (<) Needs a test like for $high. Test plan : 1) Run prove t/db_dependent/Koha/Patrons.t 2) Edit a patron catetory, empty "Age required" and save 3) Edit a patron of this category 4) Check in logs you don't see "Use of uninitialized value $low in numeric lt (<)" --- Koha/Patron.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 9c8de9b014..4448f58cce 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -1106,7 +1106,7 @@ sub is_valid_age { my $patroncategory = $self->category; my ($low,$high) = ($patroncategory->dateofbirthrequired, $patroncategory->upperagelimit); - return (defined($age) && (($high && ($age > $high)) or ($age < $low))) ? 0 : 1; + return (defined($age) && (($high && ($age > $high)) or ($low && ($age < $low)))) ? 0 : 1; } =head3 account -- 2.27.0