Bug 26417 - Remove warn in Koha::Patron is_valid_age
Summary: Remove warn in Koha::Patron is_valid_age
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on: 17492
Blocks: 25515
  Show dependency treegraph
 
Reported: 2020-09-09 11:52 UTC by Fridolin Somers
Modified: 2020-11-25 12:20 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 26417: Remove warn in Koha::Patron is_valid_age (1.21 KB, patch)
2020-09-09 11:57 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 26922: Regression tests (7.49 KB, patch)
2020-11-21 13:37 UTC, Michal Denar
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2020-09-09 11:52:45 UTC
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.
Comment 1 Fridolin Somers 2020-09-09 11:57:24 UTC
Created attachment 109790 [details] [review]
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 (<)"
Comment 2 Michal Denar 2020-11-21 13:37:20 UTC
Created attachment 113909 [details] [review]
Bug 26922: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Comment 3 Joonas Kylmälä 2020-11-25 12:20:56 UTC
This seems to have Signed off status accidentally marked from when the patch relating to other bug was accidentally added here. Moving to Needs Signoff.