[Koha-bugs] [Bug 26590] New: Koha::Patron::is_valid_age gives warning about $low variable's numeric comparison

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Oct 1 08:42:18 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26590

            Bug ID: 26590
           Summary: Koha::Patron::is_valid_age gives warning about $low
                    variable's numeric comparison
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: trivial
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: joonas.kylmala at helsinki.fi
        QA Contact: testopia at bugs.koha-community.org

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list