[Bug 32604] New: Patron categories upper age limit not respected when creating a patron
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 Bug ID: 32604 Summary: Patron categories upper age limit not respected when creating a patron Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: emmi.takkinen@koha-suomi.fi QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Koha treats patron categories upper age limit inconsistently. E.g. if child patron category's upper age limit is 18, one is still able to add child patron who is 18 years old. However, when cronjob update_patrons_category.pl is run, patrons over and exactly aged 18 are considered overaged and their categorycode is updated. We should either fix patron creation or cronjob to avoid confusion. To test: 1. Add upper age limit as 18 for child patron category. 2. Create a child patron whose age is 18. 3. Save. => Patron is saved successfully. 4. Run cronjob update_patrons_category.pl with verbose option. perl update_patrons_category.pl --too_old --from CHILD --to ADULT -v => Note that patron is reported as updated (or would have updated) as an adult patron. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@ptfs-europe |ity.org |.com CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hdunne-howrie@westminster.g | |ov.uk --- Comment #1 from Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> --- We need this functionality. We had this in our previous library system so moving to Koha and this not working correctly is a problem for us as it has created a manual task for system admins. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 Bernard <bernard.scaife@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bernard.scaife@ptfs-europe. | |com --- Comment #2 from Bernard <bernard.scaife@ptfs-europe.com> --- This is because the calculation of whether a user is over the upperagelimit or not in Patrons.pm is incorrect. For example, a user is not over the age of 11 until their 12th birthday. See this url for a patch that I think would resolve this which I've tested on 24.11: https://github.com/kbwhizz/kohafixes/commit/087ca86dc12d6d42242732dce86bd6a3... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 Jake Deery <jake.deery@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jake.deery@ptfs-europe.com Assignee|martin.renvoize@ptfs-europe |jake.deery@ptfs-europe.com |.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 --- Comment #3 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 179417 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179417&action=edit Bug 32604: Correct boundary calculation for birthdate Add 1 to upperagelimit to make it calculate birthday boundaries correctly for patrons_to_update_category search To test: 1. Add upper age limit as 18 for child patron category. 2. Create a child patron whose age is 18. 3. Save. => Patron is saved successfully. 4. Run cronjob update_patrons_category.pl with verbose option. perl update_patrons_category.pl --too_old --from CHILD --to ADULT -v => Note that patron is reported as updated (or would have updated) as an adult patron. 5. Apply patch 6. Re-run steps 1 to 5 and note we no long update the 18 year olds. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #179417|0 |1 is obsolete| | --- Comment #4 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 179422 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179422&action=edit Bug 32604: Correct boundary calculation for birthdate Add 1 to upperagelimit to make it calculate birthday boundaries correctly for patrons_to_update_category search To test: 1. Add upper age limit as 18 for child patron category. 2. Create a child patron whose age is 18. 3. Save. => Patron is saved successfully. 4. Run cronjob update_patrons_category.pl with verbose option. perl update_patrons_category.pl --too_old --from CHILD --to ADULT -v => Note that patron is reported as updated (or would have updated) as an adult patron. 5. Apply patch 6. Re-run steps 1 to 5 and note we no long update the 18 year olds. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 --- Comment #5 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 179423 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179423&action=edit Bug 32604: Unit tests Add unit tests to more thoroughly and specifically cover the search_patrons_to_update_category method including specific date handling tests. We also add some notes to the POD that were highlighted by writing comprehensive tests. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|jake.deery@ptfs-europe.com |bernard.scaife@ptfs-europe. | |com Status|NEW |Needs Signoff QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 --- Comment #6 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Bernard wrote the original work here, I just tidied it up for submission and then added unit tests. Leaving it as assigned (and committed) by him so he gets the recognition and adding my own signoff as I've thoroughly tested it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|martin.renvoize@ptfs-europe |testopia@bugs.koha-communit |.com |y.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #179422|0 |1 is obsolete| | --- Comment #7 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 179434 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179434&action=edit Bug 32604: Correct boundary calculation for birthdate Add 1 to upperagelimit to make it calculate birthday boundaries correctly for patrons_to_update_category search To test: 1. Add upper age limit as 18 for child patron category. 2. Create a child patron whose age is 18. 3. Save. => Patron is saved successfully. 4. Run cronjob update_patrons_category.pl with verbose option. perl update_patrons_category.pl --too_old --from CHILD --to ADULT -v => Note that patron is reported as updated (or would have updated) as an adult patron. 5. Apply patch 6. Re-run steps 1 to 5 and note we no long update the 18 year olds. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #179423|0 |1 is obsolete| | --- Comment #8 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 179435 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179435&action=edit Bug 32604: Unit tests Add unit tests to more thoroughly and specifically cover the search_patrons_to_update_category method including specific date handling tests. We also add some notes to the POD that were highlighted by writing comprehensive tests. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 --- Comment #9 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Tested and everything works as expected. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |emmi.takkinen@koha-suomi.fi |y.org | --- Comment #10 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Promoting Emmi's Signoff to a PQA.. two solid sets of eyes on this :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- FAIL Koha/Patrons.pm FAIL spelling precidence ==> precedence Fixed inline. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |25.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 25.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting CC| |fridolin.somers@biblibre.co | |m --- Comment #13 from Fridolin Somers <fridolin.somers@biblibre.com> --- I understand the bug, but this changes the behavior of a cronjob. I prefer not impact 24.11.x LTS for stability. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32604 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |40992 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40992 [Bug 40992] Koha/Patrons.t failing on "Test edge cases with date calculations" (midnight) -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org