[Bug 41886] New: Biblio::check_booking counts checkouts on non-bookable items causing false clashes
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41886 Bug ID: 41886 Summary: Biblio::check_booking counts checkouts on non-bookable items causing false clashes Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: paul.derscheid@lmscloud.de QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com - Biblio::check_booking uses $self->current_checkouts to count checked-out items overlapping with a booking period - This counts checkouts on ALL items for the biblio, including non-bookable ones (e.g. items with an excluded item type) - When only a subset of items are bookable, checkouts on non-bookable siblings incorrectly reduce the available pool, producing false clashes - The integer-based counting ($booked_count) can also double-count an item that has both an active booking and an active checkout, further inflating the unavailable count Steps to reproduce: - Have a biblio with multiple items where only some are bookable - Check out one or more of the non-bookable items - Create a booking on one of the bookable items - Clash is incorrectly detected even though all bookable items are available -- 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=41886 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=41886 --- Comment #1 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 193375 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193375&action=edit Bug 41886: Filter checkouts to bookable items in check_booking - Biblio::check_booking counts current checkouts toward the unavailable pool to detect booking clashes - It counts checkouts on ALL items for the biblio, including non-bookable ones (e.g. items with an excluded item type) - When only a subset of items are bookable, checkouts on non-bookable siblings incorrectly reduce the available pool, producing false clashes - Restrict the checkout query to only count items whose itemnumber is in the bookable items set To test: 1. Have a biblio with at least two items, where one item is bookable and the other is not (bookable = 0). 2. Check out the non-bookable item to a patron. 3. Attempt to create a booking for the bookable item. 4. Without the patch: a clash is detected even though the bookable item is available. 5. Apply the patch. 6. Repeat steps 2-3. 7. Verify the booking succeeds without a false clash. 8. Run: prove t/db_dependent/Koha/Biblio.t and confirm the new subtest "checkouts on non-bookable items do not cause false clashes" passes. -- 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=41886 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |29002 Circulation| |Bookings function| | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29002 [Bug 29002] Add ability to book items ahead of time -- 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=41886 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- 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=41886 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193375|0 |1 is obsolete| | -- 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=41886 --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 193533 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193533&action=edit Bug 41886: Filter checkouts to bookable items in check_booking - Biblio::check_booking counts current checkouts toward the unavailable pool to detect booking clashes - It counts checkouts on ALL items for the biblio, including non-bookable ones (e.g. items with an excluded item type) - When only a subset of items are bookable, checkouts on non-bookable siblings incorrectly reduce the available pool, producing false clashes - Restrict the checkout query to only count items whose itemnumber is in the bookable items set To test: 1. Have a biblio with at least two items, where one item is bookable and the other is not (bookable = 0). 2. Check out the non-bookable item to a patron. 3. Attempt to create a booking for the bookable item. 4. Without the patch: a clash is detected even though the bookable item is available. 5. Apply the patch. 6. Repeat steps 2-3. 7. Verify the booking succeeds without a false clash. 8. Run: prove t/db_dependent/Koha/Biblio.t and confirm the new subtest "checkouts on non-bookable items do not cause false clashes" passes. Signed-off-by: David Nind <david@davidnind.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=41886 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Assignee|koha-bugs@lists.koha-commun |paul.derscheid@lmscloud.de |ity.org | -- 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=41886 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@openfifth.c |y.org |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41886 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Sponsorship status|--- |Sponsored Status|Signed Off |Passed QA Comma delimited| |Büchereizentrale list of Sponsors| |Schleswig-Holstein | |<https://www.bz-sh.de/> Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41886 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193533|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41886 --- Comment #3 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 193774 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193774&action=edit Bug 41886: Filter checkouts to bookable items in check_booking - Biblio::check_booking counts current checkouts toward the unavailable pool to detect booking clashes - It counts checkouts on ALL items for the biblio, including non-bookable ones (e.g. items with an excluded item type) - When only a subset of items are bookable, checkouts on non-bookable siblings incorrectly reduce the available pool, producing false clashes - Restrict the checkout query to only count items whose itemnumber is in the bookable items set To test: 1. Have a biblio with at least two items, where one item is bookable and the other is not (bookable = 0). 2. Check out the non-bookable item to a patron. 3. Attempt to create a booking for the bookable item. 4. Without the patch: a clash is detected even though the bookable item is available. 5. Apply the patch. 6. Repeat steps 2-3. 7. Verify the booking succeeds without a false clash. 8. Run: prove t/db_dependent/Koha/Biblio.t and confirm the new subtest "checkouts on non-bookable items do not cause false clashes" passes. Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41886 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Comma delimited|Büchereizentrale |Büchereizentrale list of Sponsors|Schleswig-Holstein |Schleswig-Holstein |<https://www.bz-sh.de/> |<https://www.bz-sh.de/> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41886 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.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=41886 --- Comment #4 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41886 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|26.05.00 |26.05.00,25.11.04 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41886 --- Comment #5 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Thanks all, pushed to 25.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41886 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|26.05.00,25.11.04 |26.05.00,25.11.04,25.05.11 released in| | Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41886 --- Comment #6 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Nice work everyone! Pushed to main for 25.05.09 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41886 --- Comment #7 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Correction: this was pushed for 25.05.11. --LE -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41886 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |baptiste.wojtkowski@biblibr | |e.com Version(s)|26.05.00,25.11.04,25.05.11 |26.05.00,25.11.04,25.05.11, released in| |24.11.16 Status|Pushed to oldstable |Needs documenting --- Comment #8 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- Pushed into 24.11.x for 24.11.16 nice work everyone -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41886 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED --- Comment #9 from David Nind <david@davidnind.com> --- Bug fix, no changes to the manual required. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org