[Bug 37155] New: Remove unnecessary unblessing of patron in CanItemBeReserved
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37155 Bug ID: 37155 Summary: Remove unnecessary unblessing of patron in CanItemBeReserved Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org We unbless the patron here to pass to GetAgeRestriction which needs only the patron's dob to perform age calculations -- 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=37155 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=37155 --- Comment #1 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 167967 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167967&action=edit Bug 37155: Refactor GetAgeRestrictions This routine currently takes the agerestriction value from biblioitems and an unblessed borrower object and uses the date of birth to calculate whether the ptrons DOB is before or after the minimum value required against the age restriction We have a routine in the patron object to get the patron's age - we cna use this against the parsed agerestriction value in a simple comparison and remove the need to unbless and pass the patron. FIXME: We should move this to a biblioitems or biblio object method To test: 0 - In Admin -> Koha to MARC mapping, set biblioitems.agerestriction to 521,a 1 - Set syspref AgeRestrictionMarker to 'Age' 2 - Edit a record and set 521$a to 'Age 14' 3 - Add an item or copy the barcode of the item on that record 4 - Attempt to checkout item to Lisa Charles in sample data, or a 15 year old patron 5 - It should checkout fine 6 - Check in item 7 - Edit patron Joyce Gaines to set age to 13 DOB:06/20/2011, or create a 13 year old patron 8 - Attempt to checkout item 9 - Item is blocked 10 - Apply patch 11 - Repeat tests, confirm no change -- 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=37155 --- Comment #2 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 167968 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167968&action=edit Bug 37155: Remove use of unblessed patron This removes the unblessing of the patron object and uses fields form the patron To test: Confirm tests still pass: prove -v t/db_dependent/Holds.t t/db_dependent/Circulation.t t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t t/db_dependent/Reserves.t t/db_dependent/api/v1/holds.t -- 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=37155 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- 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=37155 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |37154 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37154 [Bug 37154] [OMNIBUS] Remove all unnecessary uses of unbless -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37155 Brendan Lawlor <blawlor@clamsnet.org> 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=37155 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167967|0 |1 is obsolete| | --- Comment #3 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 167991 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167991&action=edit Bug 37155: Refactor GetAgeRestrictions This routine currently takes the agerestriction value from biblioitems and an unblessed borrower object and uses the date of birth to calculate whether the ptrons DOB is before or after the minimum value required against the age restriction We have a routine in the patron object to get the patron's age - we cna use this against the parsed agerestriction value in a simple comparison and remove the need to unbless and pass the patron. FIXME: We should move this to a biblioitems or biblio object method To test: 0 - In Admin -> Koha to MARC mapping, set biblioitems.agerestriction to 521,a 1 - Set syspref AgeRestrictionMarker to 'Age' 2 - Edit a record and set 521$a to 'Age 14' 3 - Add an item or copy the barcode of the item on that record 4 - Attempt to checkout item to Lisa Charles in sample data, or a 15 year old patron 5 - It should checkout fine 6 - Check in item 7 - Edit patron Joyce Gaines to set age to 13 DOB:06/20/2011, or create a 13 year old patron 8 - Attempt to checkout item 9 - Item is blocked 10 - Apply patch 11 - Repeat tests, confirm no change Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37155 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167968|0 |1 is obsolete| | --- Comment #4 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 167992 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167992&action=edit Bug 37155: Remove use of unblessed patron This removes the unblessing of the patron object and uses fields form the patron To test: Confirm tests still pass: prove -v t/db_dependent/Holds.t t/db_dependent/Circulation.t t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t t/db_dependent/Reserves.t t/db_dependent/api/v1/holds.t Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37155 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |blawlor@clamsnet.org --- Comment #5 from Brendan Lawlor <blawlor@clamsnet.org> --- Tested before and after patch and confirm no changes in behavior. prove -v t/db_dependent/Holds.t t/db_dependent/Circulation.t t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t t/db_dependent/Reserves.t t/db_dependent/api/v1/holds.t All tests successful. Files=5, Tests=252, 58 wallclock secs ( 0.24 usr 0.07 sys + 44.99 cusr 4.90 csys = 50.20 CPU) Result: PASS -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37155 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167991|0 |1 is obsolete| | --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168265 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168265&action=edit Bug 37155: Refactor GetAgeRestrictions This routine currently takes the agerestriction value from biblioitems and an unblessed borrower object and uses the date of birth to calculate whether the ptrons DOB is before or after the minimum value required against the age restriction We have a routine in the patron object to get the patron's age - we cna use this against the parsed agerestriction value in a simple comparison and remove the need to unbless and pass the patron. FIXME: We should move this to a biblioitems or biblio object method To test: 0 - In Admin -> Koha to MARC mapping, set biblioitems.agerestriction to 521,a 1 - Set syspref AgeRestrictionMarker to 'Age' 2 - Edit a record and set 521$a to 'Age 14' 3 - Add an item or copy the barcode of the item on that record 4 - Attempt to checkout item to Lisa Charles in sample data, or a 15 year old patron 5 - It should checkout fine 6 - Check in item 7 - Edit patron Joyce Gaines to set age to 13 DOB:06/20/2011, or create a 13 year old patron 8 - Attempt to checkout item 9 - Item is blocked 10 - Apply patch 11 - Repeat tests, confirm no change Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> 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=37155 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167992|0 |1 is obsolete| | --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168266 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168266&action=edit Bug 37155: Remove use of unblessed patron This removes the unblessing of the patron object and uses fields form the patron To test: Confirm tests still pass: prove -v t/db_dependent/Holds.t t/db_dependent/Circulation.t t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t t/db_dependent/Reserves.t t/db_dependent/api/v1/holds.t Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> 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=37155 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com CC| |martin.renvoize@ptfs-europe | |.com --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- It's great to see cleanups like this taking place, thanks Nick. All working great and no regressions were spotted in testing. QA scripts happy. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37155 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37155 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! 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=37155 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|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=37155 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|24.11.00 |24.11.00,24.05.06 released in| | Status|Pushed to main |Pushed to stable CC| |lucas@bywatersolutions.com --- Comment #10 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Backported to 24.05.x for upcoming 24.05.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37155 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Status|Pushed to stable |Needs documenting --- Comment #11 from Fridolin Somers <fridolin.somers@biblibre.com> --- I prefer not backport this refactoring to 23.11.x for stability -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37155 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED CC| |caroline.cyr-la-rose@inlibr | |o.com Resolution|--- |FIXED --- Comment #12 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- Internal architecture, nothing to add/edit in the manual. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org