Bug 26590 - Koha::Patron::is_valid_age gives warning about $low variable's numeric comparison
Summary: Koha::Patron::is_valid_age gives warning about $low variable's numeric compar...
Status: RESOLVED DUPLICATE of bug 26417
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 25790
  Show dependency treegraph
 
Reported: 2020-10-01 06:42 UTC by Joonas Kylmälä
Modified: 2022-05-17 11:57 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***