[Bug 40644] New: Bookings biblio checks erroneously if multiple check-outs and bookings exist
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40644 Bug ID: 40644 Summary: Bookings biblio checks erroneously if multiple check-outs and bookings exist Change sponsored?: --- 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: pedro.amorim@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.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=40644 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@openfifth.c | |o.uk, | |pedro.amorim@openfifth.co.u | |k -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40644 Pedro Amorim <pedro.amorim@openfifth.co.uk> 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=40644 --- Comment #1 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- Created attachment 185358 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185358&action=edit Bug 40644: Only count checkouts that have not yet been counted as bookings Test plan: 1) Have a record with 8 items. 2) Place a booking on 6 of the items (6 bookings total) for a full month (e.g. August) 3) Check-out all 6 of those bookings 4) Attempt to place a new booking for one of the 2 free items. 5) It will fail with error "Booking conflicts". This is because the code is adding 6 checkouts with 6 bookings = 12 which is higher than 8 bookable items. 6) With this patch, check-outs that refer to an existing booking are excluded, so the check becomes if 8 - 6 > 0 (which passes the check) rather than 8 - 12 > 0 (which fails the check) -- 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=40644 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185358|0 |1 is obsolete| | --- Comment #2 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- Created attachment 185359 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185359&action=edit Bug 40644: Only count checkouts that have not yet been counted as bookings Test plan: 1) Have a record with 8 items. 2) Place a booking on 6 of the items (6 bookings total) for a full month (e.g. August) 3) Check-out all 6 of those bookings 4) Attempt to place a new booking for one of the 2 free items for end of month, e.g. (Aug 26 -> Aug 28). 5) It will fail with error "Booking conflicts". This is because the code is adding 6 checkouts with 6 bookings = 12 which is higher than 8 bookable items. 6) With this patch, check-outs that refer to an existing booking are excluded, so the check becomes if 8 - 6 > 0 (which passes the check) rather than 8 - 12 > 0 (which fails the check) Run existing tests: prove t/db_dependent/Koha/Item.t prove t/db_dependent/Koha/Biblio.t prove t/db_dependent/Koha/Booking.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=40644 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185359|0 |1 is obsolete| | --- Comment #3 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- Created attachment 185360 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185360&action=edit Bug 40644: Only count checkouts that have not yet been counted as bookings Test plan: 1) Have a record with 8 items. 2) Place a booking on 6 of the items (6 bookings total) for a full month (e.g. August) 3) Check-out all 6 of those bookings 4) Attempt to place a new booking for one of the 2 free items for end of month, e.g. (Aug 26 -> Aug 28). 5) It will fail with error "Booking conflicts". This is because the code is adding 6 checkouts with 6 bookings = 12 which is higher than 8 bookable items. 6) With this patch, check-outs that refer to an existing booking are excluded, so the check becomes if 8 - 6 > 0 (which passes the check) rather than 8 - 12 > 0 (which fails the check) Run existing tests: prove t/db_dependent/Koha/Item.t prove t/db_dependent/Koha/Biblio.t prove t/db_dependent/Koha/Booking.t -- 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=40644 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@openfifth.c |y.org |o.uk Assignee|koha-bugs@lists.koha-commun |pedro.amorim@openfifth.co.u |ity.org |k --- Comment #4 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- Adding Martin as QA here for when he's available. -- 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=40644 Andrew Fuerste-Henry <andrew@bywatersolutions.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=40644 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185360|0 |1 is obsolete| | --- Comment #5 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 185417 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185417&action=edit Bug 40644: Only count checkouts that have not yet been counted as bookings Test plan: 1) Have a record with 8 items. 2) Place a booking on 6 of the items (6 bookings total) for a full month (e.g. August) 3) Check-out all 6 of those bookings 4) Attempt to place a new booking for one of the 2 free items for end of month, e.g. (Aug 26 -> Aug 28). 5) It will fail with error "Booking conflicts". This is because the code is adding 6 checkouts with 6 bookings = 12 which is higher than 8 bookable items. 6) With this patch, check-outs that refer to an existing booking are excluded, so the check becomes if 8 - 6 > 0 (which passes the check) rather than 8 - 12 > 0 (which fails the check) Run existing tests: prove t/db_dependent/Koha/Item.t prove t/db_dependent/Koha/Biblio.t prove t/db_dependent/Koha/Booking.t Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40644 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- How hard would it be to add a small test here? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40644 --- Comment #7 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- (In reply to Marcel de Rooy from comment #6)
How hard would it be to add a small test here?
I believe it shouldn't be too hard but unfortunately I had to jump on to other things as soon as I found the fix here. I'm happy to note this down to write some tests whenever I'm able to. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40644 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40644 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185417|0 |1 is obsolete| | --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 186129 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186129&action=edit Bug 40644: Only count checkouts that have not yet been counted as bookings Test plan: 1) Have a record with 8 items. 2) Place a booking on 6 of the items (6 bookings total) for a full month (e.g. August) 3) Check-out all 6 of those bookings 4) Attempt to place a new booking for one of the 2 free items for end of month, e.g. (Aug 26 -> Aug 28). 5) It will fail with error "Booking conflicts". This is because the code is adding 6 checkouts with 6 bookings = 12 which is higher than 8 bookable items. 6) With this patch, check-outs that refer to an existing booking are excluded, so the check becomes if 8 - 6 > 0 (which passes the check) rather than 8 - 12 > 0 (which fails the check) Run existing tests: prove t/db_dependent/Koha/Item.t prove t/db_dependent/Koha/Biblio.t prove t/db_dependent/Koha/Booking.t Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40644 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|martin.renvoize@openfifth.c |m.de.rooy@rijksmuseum.nl |o.uk | --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Pedro Amorim from comment #7)
I believe it shouldn't be too hard but unfortunately I had to jump on to other things as soon as I found the fix here. I'm happy to note this down to write some tests whenever I'm able to.
Wont insist for this one line. Passing as an exception to the rule.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40644 --- Comment #10 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- Created attachment 186159 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186159&action=edit Bug 40644: Add tests If you apply this patch before the other one: prove t/db_dependent/Koha/Biblio.t Will fail. Apply both patches. The above now passes. This highlighted something. Following the test plan I can't reproduce this anymore. In order to reproduce, the check-outs need to happen before the bookings, otherwise when the check-outs happen on an existing booking it'll 'complete' or 'cancel' the booking thus not causing the error. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40644 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186159|0 |1 is obsolete| | --- Comment #11 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- Created attachment 186161 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186161&action=edit Bug 40644: Add tests If you apply this patch before the other one: prove t/db_dependent/Koha/Biblio.t Will fail. Apply both patches. The above now passes. This highlighted something. Following the test plan I can't reproduce this anymore. In order to reproduce, the check-outs need to happen before the bookings, otherwise when the check-outs happen on an existing booking it'll 'complete' or 'cancel' the booking thus not causing the error. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40644 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |25.11.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=40644 --- Comment #12 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 25.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40644 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|25.11.00 |25.11.00,25.05.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=40644 --- Comment #13 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Nice work everyone! Pushed to 25.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40644 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Circulation| |Bookings function| | CC| |fridolin.somers@biblibre.co | |m --- Comment #14 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 24.11.x for 24.11.10 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40644 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|25.11.00,25.05.04 |25.11.00,25.05.04,24.11.10 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40644 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |29002 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 watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40644 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Needs documenting --- Comment #15 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11.x as it wasn't backported to 24.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org