Bug 26590

Summary: Koha::Patron::is_valid_age gives warning about $low variable's numeric comparison
Product: Koha Reporter: Joonas Kylmälä <joonas.kylmala>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: fridolin.somers, jonathan.druart
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 25790    

Description Joonas Kylmälä 2020-10-01 06:42:18 UTC
I get the following warning message in plack-error.log:

> Use of uninitialized value $low in numeric lt (<) at /usr/share/koha/lib/Koha/Patron.pm line 1109.

This seems to happen because in /cgi-bin/koha/admin/categories.pl you can set "Age required" field to be empty and then in the is_valid_age subroutine in Patron.pm we compare patroncategory->dateofbirthrequired to numeric value and empty string or undef is not numeric.

We should either add input validation to categories.pl or convert dateofbirthrequired to numeric value.
Comment 1 Fridolin Somers 2021-02-05 16:15:18 UTC

*** This bug has been marked as a duplicate of bug 26417 ***