| Summary: | Biblio::check_booking counts checkouts on non-bookable items causing false clashes | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Paul Derscheid <paul.derscheid> |
| Component: | Circulation | Assignee: | Paul Derscheid <paul.derscheid> |
| Status: | Signed Off --- | QA Contact: | Testopia <testopia> |
| Severity: | normal | ||
| Priority: | P5 - low | CC: | david, gmcharlt, kyle |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | Bookings | ||
| Bug Depends on: | 29002 | ||
| Bug Blocks: | |||
| Attachments: |
Bug 41886: Filter checkouts to bookable items in check_booking
Bug 41886: Filter checkouts to bookable items in check_booking |
||
|
Description
Paul Derscheid
2026-02-19 10:39:35 UTC
Created attachment 193375 [details] [review] 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. Created attachment 193533 [details] [review] 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> |