[Bug 42443] New: Update transferstoreceive.pl to use the API to fetch transfer information
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Bug ID: 42443 Summary: Update transferstoreceive.pl to use the API to fetch transfer information Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: andrew@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com The Transfers to Receive page is a pain point for larger systems with many transfers. We should update it to fetch data via API. -- 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=42443 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |42643 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42643 [Bug 42643] [OMNIBUS] Assorted performance and stability work -- 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=42443 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |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=42443 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #1 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 199854 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199854&action=edit Bug 42443: Add REST API for item transfers Patch from commit 31e07e8 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #2 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 199855 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199855&action=edit Bug 42443: Add unit tests Patch from commit fd88d77 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #3 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 199856 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199856&action=edit Bug 42443: Convert transfers to receive page to ajax datatable Updates circ/transferstoreceive.pl to use the new REST API with an ajax DataTable to display transfer to receive. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Set an item in transit to your logged in library ( check it in at another branch so it is sent home, or place a hold to trigger a transfer ) 4) Place a hold on a second transferred item, and a recall on a third 5) Browse to /cgi-bin/koha/circ/transferstoreceive.pl 6) Note the "On hold for" column shows the hold patron, the recall patron or "None" 7) Set TransfersMaxDaysWarning low and note the "days late" badge appears 8) Click "Cancel transfer" and note the transfer is cancelled 9) A library with no incoming transfers will get "No transfers to receive" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #4 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 199857 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199857&action=edit Bug 42443: Add ability to cancel a transfer via the REST API This patch adds a DELETE /transfers/{transfer_id} route that cancels the given transfer by id and reverts an in transit recall for the item the same way as returns.pl does. The cancellation reason is passed in the request body so this api endpoint could be used in other places we can cancel transfers. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@openfifth.c |y.org |o.uk CC| |lisette@bywatersolutions.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Alex Carver [Acerock7] <alex@rcls.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=42443 Alex Carver [Acerock7] <alex@rcls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199854|0 |1 is obsolete| | Attachment #199855|0 |1 is obsolete| | Attachment #199856|0 |1 is obsolete| | Attachment #199857|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=42443 --- Comment #5 from Alex Carver [Acerock7] <alex@rcls.org> --- Created attachment 200105 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200105&action=edit Bug 42443: Add REST API for item transfers Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #6 from Alex Carver [Acerock7] <alex@rcls.org> --- Created attachment 200106 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200106&action=edit Bug 42443: Add unit tests Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #7 from Alex Carver [Acerock7] <alex@rcls.org> --- Created attachment 200107 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200107&action=edit Bug 42443: Convert transfers to receive page to ajax datatable Updates circ/transferstoreceive.pl to use the new REST API with an ajax DataTable to display transfer to receive. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Set an item in transit to your logged in library ( check it in at another branch so it is sent home, or place a hold to trigger a transfer ) 4) Place a hold on a second transferred item, and a recall on a third 5) Browse to /cgi-bin/koha/circ/transferstoreceive.pl 6) Note the "On hold for" column shows the hold patron, the recall patron or "None" 7) Set TransfersMaxDaysWarning low and note the "days late" badge appears 8) Click "Cancel transfer" and note the transfer is cancelled 9) A library with no incoming transfers will get "No transfers to receive" Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #8 from Alex Carver [Acerock7] <alex@rcls.org> --- Created attachment 200108 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200108&action=edit Bug 42443: Add ability to cancel a transfer via the REST API This patch adds a DELETE /transfers/{transfer_id} route that cancels the given transfer by id and reverts an in transit recall for the item the same way as returns.pl does. The cancellation reason is passed in the request body so this api endpoint could be used in other places we can cancel transfers. Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Initiative type|--- |Feature -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Medium patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> 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=42443 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200105|0 |1 is obsolete| | Attachment #200106|0 |1 is obsolete| | Attachment #200107|0 |1 is obsolete| | Attachment #200108|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=42443 --- Comment #9 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200291 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200291&action=edit Bug 42443: Add REST API for item transfers Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> 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=42443 --- Comment #10 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200292 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200292&action=edit Bug 42443: Add unit tests Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> 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=42443 --- Comment #11 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200293 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200293&action=edit Bug 42443: Convert transfers to receive page to ajax datatable Updates circ/transferstoreceive.pl to use the new REST API with an ajax DataTable to display transfer to receive. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Set an item in transit to your logged in library ( check it in at another branch so it is sent home, or place a hold to trigger a transfer ) 4) Place a hold on a second transferred item, and a recall on a third 5) Browse to /cgi-bin/koha/circ/transferstoreceive.pl 6) Note the "On hold for" column shows the hold patron, the recall patron or "None" 7) Set TransfersMaxDaysWarning low and note the "days late" badge appears 8) Click "Cancel transfer" and note the transfer is cancelled 9) A library with no incoming transfers will get "No transfers to receive" Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> 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=42443 --- Comment #12 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200294 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200294&action=edit Bug 42443: Add ability to cancel a transfer via the REST API This patch adds a DELETE /transfers/{transfer_id} route that cancels the given transfer by id and reverts an in transit recall for the item the same way as returns.pl does. The cancellation reason is passed in the request body so this api endpoint could be used in other places we can cancel transfers. Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> 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=42443 --- Comment #13 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200295 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200295&action=edit Bug 42443: (QA follow-up) Prevent cancelling completed transfers The delete endpoint was passing force => 1 to cancel() with no state guards, allowing already-received and already-cancelled transfers to be re-cancelled, corrupting datearrived/datecancelled audit fields. Add explicit 400 responses for both cases and tests to cover them. 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=42443 --- Comment #14 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200296 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200296&action=edit Bug 42443: (QA follow-up) Add to_library to embed enum Koha::Item::Transfer exposes a to_library() method and the definition already listed to_library as a valid property, but the x-koha-embed enum was missing the entry. Add it so consumers can embed it. 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=42443 --- Comment #15 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200297 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200297&action=edit Bug 42443: (QA follow-up) Guard nullable embed access in JS renderers from_library and home_library can be null if a transfer references an orphaned branch row. Accessing .name on null throws a TypeError and crashes the DataTable renderer; guard both accesses. 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=42443 --- Comment #16 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200298 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200298&action=edit Bug 42443: (QA follow-up) Fix escaping of branchcode in JS context Using | html to embed a TT value inside a JS string literal is incorrect: it produces HTML entities rather than JS-safe characters. Store the branchcode in a data attribute (where | html is correct) and read it from there in JavaScript. 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=42443 --- Comment #17 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200299 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200299&action=edit Bug 42443: (QA follow-up) Test UseRecalls integration in transfer cancel The delete() controller reverts any in-transit recall tied to the item when UseRecalls is enabled. Add a subtest to verify the recall status is set back to 'requested' after the transfer is cancelled. 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=42443 --- Comment #18 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200300 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200300&action=edit Bug 42443: (QA follow-up) Test from_library_id query filter The OpenAPI spec documents from_library_id as a supported filter parameter but the test suite only exercised to_library_id. Add a test to verify filtering by source library returns the correct transfer. 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=42443 --- Comment #19 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200301 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200301&action=edit Bug 42443: (QA follow-up) Group transfers by sending library using rowGroup 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=42443 --- Comment #20 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200302 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200302&action=edit Bug 42443: (QA follow-up) Add DBIC relationship aliases on Branchtransfer The REST framework resolves _order_by parameters and embed prefetches by walking prefetch_whitelist, which is built from DBIC relationship names. The auto-generated relationships use the FK column names (itemnumber, frombranch, tobranch), but the API exposes them as item, from_library, and to_library. Sorting by item.biblio.title etc. threw a 500 because those names were not in the whitelist. Adding belongs_to aliases below the DO NOT MODIFY line bridges the API names to the DBIC names, matching the convention used by other Koha schema result classes (e.g. Koha::Schema::Result::Item). Also updates the relation methods in Koha::Item::Transfer to use the new aliases consistently, so the accessor names line up across both layers. 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=42443 --- Comment #21 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200303 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200303&action=edit Bug 42443: (QA follow-up) Use library selects for Sent from and Home library filters Replace the free-text filter inputs for the "Sent from" and "Home library" columns with select dropdowns populated from the full library list, consistent with other DataTables pages such as the pending bookings page. The "Sent from" column is made visible again (it was previously hidden since rowGroup provides the visual grouping); showing it also allows its filter cell to render. The "On hold for" column intentionally has no filter: it is computed from two different embedded sub-objects (item.first_hold.patron or item.recall.patron) and has no single API field to filter against server-side. 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=42443 --- Comment #22 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- OK.. that grew a bit.. The more I reviewed it the more small, but important, things became apparent to me. Lots of small QA follow-ups to add the requisite polish and restore small functional regressions. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |oleonard@myacpl.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |43017 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43017 [Bug 43017] [OMNIBUS] Interface optimization -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|42643 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42643 [Bug 42643] [OMNIBUS] Assorted performance and stability work -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Patch doesn't apply CC| |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=42443 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200291|0 |1 is obsolete| | Attachment #200292|0 |1 is obsolete| | Attachment #200293|0 |1 is obsolete| | Attachment #200294|0 |1 is obsolete| | Attachment #200295|0 |1 is obsolete| | Attachment #200296|0 |1 is obsolete| | Attachment #200297|0 |1 is obsolete| | Attachment #200298|0 |1 is obsolete| | Attachment #200299|0 |1 is obsolete| | Attachment #200300|0 |1 is obsolete| | Attachment #200301|0 |1 is obsolete| | Attachment #200302|0 |1 is obsolete| | Attachment #200303|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=42443 --- Comment #23 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 204929 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204929&action=edit Bug 42443: Add REST API for item transfers Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #24 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 204930 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204930&action=edit Bug 42443: Add unit tests Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #25 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 204931 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204931&action=edit Bug 42443: Convert transfers to receive page to ajax datatable Updates circ/transferstoreceive.pl to use the new REST API with an ajax DataTable to display transfer to receive. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Set an item in transit to your logged in library ( check it in at another branch so it is sent home, or place a hold to trigger a transfer ) 4) Place a hold on a second transferred item, and a recall on a third 5) Browse to /cgi-bin/koha/circ/transferstoreceive.pl 6) Note the "On hold for" column shows the hold patron, the recall patron or "None" 7) Set TransfersMaxDaysWarning low and note the "days late" badge appears 8) Click "Cancel transfer" and note the transfer is cancelled 9) A library with no incoming transfers will get "No transfers to receive" Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #26 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 204932 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204932&action=edit Bug 42443: Add ability to cancel a transfer via the REST API This patch adds a DELETE /transfers/{transfer_id} route that cancels the given transfer by id and reverts an in transit recall for the item the same way as returns.pl does. The cancellation reason is passed in the request body so this api endpoint could be used in other places we can cancel transfers. Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #27 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 204933 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204933&action=edit Bug 42443: (QA follow-up) Prevent cancelling completed transfers The delete endpoint was passing force => 1 to cancel() with no state guards, allowing already-received and already-cancelled transfers to be re-cancelled, corrupting datearrived/datecancelled audit fields. Add explicit 400 responses for both cases and tests to cover them. Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #28 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 204934 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204934&action=edit Bug 42443: (QA follow-up) Add to_library to embed enum Koha::Item::Transfer exposes a to_library() method and the definition already listed to_library as a valid property, but the x-koha-embed enum was missing the entry. Add it so consumers can embed it. Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #29 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 204935 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204935&action=edit Bug 42443: (QA follow-up) Guard nullable embed access in JS renderers from_library and home_library can be null if a transfer references an orphaned branch row. Accessing .name on null throws a TypeError and crashes the DataTable renderer; guard both accesses. Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #30 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 204936 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204936&action=edit Bug 42443: (QA follow-up) Fix escaping of branchcode in JS context Using | html to embed a TT value inside a JS string literal is incorrect: it produces HTML entities rather than JS-safe characters. Store the branchcode in a data attribute (where | html is correct) and read it from there in JavaScript. Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #31 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 204937 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204937&action=edit Bug 42443: (QA follow-up) Test UseRecalls integration in transfer cancel The delete() controller reverts any in-transit recall tied to the item when UseRecalls is enabled. Add a subtest to verify the recall status is set back to 'requested' after the transfer is cancelled. Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #32 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 204938 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204938&action=edit Bug 42443: (QA follow-up) Test from_library_id query filter The OpenAPI spec documents from_library_id as a supported filter parameter but the test suite only exercised to_library_id. Add a test to verify filtering by source library returns the correct transfer. Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #33 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 204939 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204939&action=edit Bug 42443: (QA follow-up) Group transfers by sending library using rowGroup Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #34 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 204940 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204940&action=edit Bug 42443: (QA follow-up) Add DBIC relationship aliases on Branchtransfer The REST framework resolves _order_by parameters and embed prefetches by walking prefetch_whitelist, which is built from DBIC relationship names. The auto-generated relationships use the FK column names (itemnumber, frombranch, tobranch), but the API exposes them as item, from_library, and to_library. Sorting by item.biblio.title etc. threw a 500 because those names were not in the whitelist. Adding belongs_to aliases below the DO NOT MODIFY line bridges the API names to the DBIC names, matching the convention used by other Koha schema result classes (e.g. Koha::Schema::Result::Item). Also updates the relation methods in Koha::Item::Transfer to use the new aliases consistently, so the accessor names line up across both layers. Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #35 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 204941 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204941&action=edit Bug 42443: (QA follow-up) Use library selects for Sent from and Home library filters Replace the free-text filter inputs for the "Sent from" and "Home library" columns with select dropdowns populated from the full library list, consistent with other DataTables pages such as the pending bookings page. The "Sent from" column is made visible again (it was previously hidden since rowGroup provides the visual grouping); showing it also allows its filter cell to render. The "On hold for" column intentionally has no filter: it is computed from two different embedded sub-objects (item.first_hold.patron or item.recall.patron) and has no single API field to filter against server-side. Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #36 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 204942 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204942&action=edit Bug 42443: (QA follow-up) Use POST /transfers/{transfer_id}/cancellation Cancelling a transfer is a state change on the resource, not a deletion of it, so it should be modelled as an action sub-resource rather than a DELETE on the transfer itself. This aligns the endpoint with the API coding guidelines (REST2: non-CRUD actions use action sub-resources; REST3.2: conflicts return 409) and with the design used in bug 43454. Changes: - Replace DELETE /transfers/{transfer_id} with POST /transfers/{transfer_id}/cancellation - Rename the controller method delete() to cancel(), look the transfer up with objects->find_rs, and return 200 with the updated resource representation instead of 204 with an empty body - Make cancellation_reason optional, defaulting to 'Manual', matching the legacy returns.pl behaviour - Return 409 with a structured error_code ('already_arrived', 'already_cancelled') when the transfer cannot be cancelled, instead of a bare 400 - Update the transfers to receive page to POST to the new endpoint and to treat 404/409 as "already gone, refresh the table" - Adapt the tests accordingly, including coverage for the default reason - The *_date API attribute names introduced by this bug are kept, as they are the guideline-compliant form (REST1.3.4.1: *_date, not date_*) Test plan: 1. Apply patch 2. Run the tests: $ ktd --shell k$ prove t/db_dependent/api/v1/transfers.t => SUCCESS: Tests pass! 3. Rebuild and validate the API spec: k$ yarn api:bundle k$ prove xt/api.t => SUCCESS: Tests pass! 4. In the staff interface, go to Circulation -> Transfers to receive, click "Cancel transfer" on a row => SUCCESS: The transfer is cancelled and the row drops off the table 5. Cancel the same transfer again from a second tab => SUCCESS: The API returns 409 (already_cancelled) and the row is treated as already gone 6. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #37 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- *** Bug 43454 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.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=42443 --- Comment #38 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |42383 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 [Bug 42383] Migrate check-in page to Vue -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |43474 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43474 [Bug 43474] Add shelving location to Transfers to receive -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting CC| |lucas@bywatersolutions.com --- Comment #39 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- enhancement, no 26.05.x backport -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org