Summary: | Remove C4::Circulation::DeleteTransfer | ||
---|---|---|---|
Product: | Koha | Reporter: | Martin Renvoize (ashimema) <martin.renvoize> |
Component: | Architecture, internals, and plumbing | Assignee: | Martin Renvoize (ashimema) <martin.renvoize> |
Status: | CLOSED FIXED | QA Contact: | Kyle M Hall (khall) <kyle> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | fridolin.somers, jonathan.druart, joonas.kylmala, kyle, nugged, stalkernoid, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This patch replaces calls to DeleteTransfer with Koha::Item::Transfer->cancel and then removes C4::Circulation::DeleteTransfer entirely.
This brings two advantages:
1. Better auditing of transfers by recording reasons for cancellation and throwing suitable errors for various conditions
2. Cleaning code from the overburdened C4::Circulation module.
|
Version(s) released in: |
21.05.00
|
Circulation function: | |||
Bug Depends on: | 27281 | ||
Bug Blocks: | 12362 | ||
Attachments: |
Bug 27896: Remove DeleteTransfer from circ/return.pl
BUg 27896: Remove DeleteTransfer Bug 27896: (follow-up) Fix Typo Bug 27896: Remove DeleteTransfer from circ/return.pl BUg 27896: Remove DeleteTransfer Bug 27896: (follow-up) Fix Typo Bug 27896: Remove DeleteTransfer from circ/return.pl BUg 27896: Remove DeleteTransfer Bug 27896: (follow-up) Fix Typo Bug 27896: (QA follow-up) Fix number of unit tests |
Description
Martin Renvoize (ashimema)
2021-03-08 15:03:42 UTC
Created attachment 117927 [details] [review] Bug 27896: Remove DeleteTransfer from circ/return.pl This patch replaces the DeleteTransfer call in circ/returns.pl with a call to Koha::Item::Transfer->cancel. Test plan 1/ Check an item out 2/ Add a transfer request for the item to a second library 3/ Attempt to check the item in at the first library 4/ Note that you should be given a 'WrongTransfer' modal and have to option to cancel. 5/ Cancel the transfer 6/ Check in the database that the transfer now has 'datecancelled' set. 7/ Add a transfer for the item again 8/ From the transferstoreceive page cancel the transfer 9/ Click cancel and again check that datecancelled is set in the database for your transfer Created attachment 117928 [details] [review] BUg 27896: Remove DeleteTransfer This patch removes the last mentions of DeleteTransfer Test plan 1/ Grep the codebase for DeleteTransfer 2/ It should no longer exist Throws software error at step 9: "click cancel" when I click the cancel button: > Can't use string ("Koha::Item") as a HASH ref while "strict refs" in use at /Koha/Object.pm line 782. Seems like the source of the problem is located in returns.pl at the line 231: > my $item = Koha::Item->find($itemnumber); I managed to fix it by changing "Koha::Item" to "Koha::Items" and it seems to work fine after that change, but please check if it's a correct solution anyway :) Created attachment 119345 [details] [review] Bug 27896: (follow-up) Fix Typo Thanks Peter, you are indeed correct. I've added a followup with the suggested typo fix. Created attachment 119347 [details] [review] Bug 27896: Remove DeleteTransfer from circ/return.pl This patch replaces the DeleteTransfer call in circ/returns.pl with a call to Koha::Item::Transfer->cancel. Test plan 1/ Check an item out 2/ Add a transfer request for the item to a second library 3/ Attempt to check the item in at the first library 4/ Note that you should be given a 'WrongTransfer' modal and have to option to cancel. 5/ Cancel the transfer 6/ Check in the database that the transfer now has 'datecancelled' set. 7/ Add a transfer for the item again 8/ From the transferstoreceive page cancel the transfer 9/ Click cancel and again check that datecancelled is set in the database for your transfer Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Created attachment 119348 [details] [review] BUg 27896: Remove DeleteTransfer This patch removes the last mentions of DeleteTransfer Test plan 1/ Grep the codebase for DeleteTransfer 2/ It should no longer exist Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Created attachment 119349 [details] [review] Bug 27896: (follow-up) Fix Typo Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Created attachment 119758 [details] [review] Bug 27896: Remove DeleteTransfer from circ/return.pl This patch replaces the DeleteTransfer call in circ/returns.pl with a call to Koha::Item::Transfer->cancel. Test plan 1/ Check an item out 2/ Add a transfer request for the item to a second library 3/ Attempt to check the item in at the first library 4/ Note that you should be given a 'WrongTransfer' modal and have to option to cancel. 5/ Cancel the transfer 6/ Check in the database that the transfer now has 'datecancelled' set. 7/ Add a transfer for the item again 8/ From the transferstoreceive page cancel the transfer 9/ Click cancel and again check that datecancelled is set in the database for your transfer Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 119759 [details] [review] BUg 27896: Remove DeleteTransfer This patch removes the last mentions of DeleteTransfer Test plan 1/ Grep the codebase for DeleteTransfer 2/ It should no longer exist Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 119760 [details] [review] Bug 27896: (follow-up) Fix Typo Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 119761 [details] [review] Bug 27896: (QA follow-up) Fix number of unit tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Pushed to master for 21.05, thanks to everybody involved! Enhancement not pushed to 20.11.x |