Bug 26417 - Remove warn in Koha::Patron is_valid_age
Summary: Remove warn in Koha::Patron is_valid_age
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
: 26590 (view as bug list)
Depends on: 17492
Blocks: 25515
  Show dependency treegraph
 
Reported: 2020-09-09 11:52 UTC by Fridolin Somers
Modified: 2021-12-13 21:09 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.02,20.05.08
Circulation function:


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
Bug 26417: Remove warn in Koha::Patron is_valid_age (1.26 KB, patch)
2020-12-27 18:50 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 26417: Remove warn in Koha::Patron is_valid_age (1.32 KB, patch)
2021-01-08 08:45 UTC, Julian Maurice
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.
Comment 4 Victor Grousset/tuxayo 2020-12-27 18:50:06 UTC
Created attachment 114710 [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 (<)"

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 5 Victor Grousset/tuxayo 2020-12-27 18:52:00 UTC
Note: no warning in the tests before the patch. Only when using the UI.
Comment 6 Julian Maurice 2021-01-08 08:45:14 UTC
Created attachment 114947 [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 (<)"

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 7 Jonathan Druart 2021-01-08 14:23:10 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 8 Fridolin Somers 2021-01-11 12:27:30 UTC
Pushed to 20.11.x for 20.11.02
Comment 9 Andrew Fuerste-Henry 2021-01-15 22:09:00 UTC
Pushed to 20.05.x for 20.05.08
Comment 10 Victor Grousset/tuxayo 2021-01-22 01:24:12 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.
Comment 11 Fridolin Somers 2021-02-05 16:15:18 UTC
*** Bug 26590 has been marked as a duplicate of this bug. ***