[Bug 26078] New: "Item returns to issuing library" creates infinite transfer loop
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26078 Bug ID: 26078 Summary: "Item returns to issuing library" creates infinite transfer loop Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal 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.m.hall@gmail.com Bug 23129 changed ModItemTransfer to set the holding branch of an item to current location when generating a transfer. This doesn't play well with the return policy "Item returns to issuing library," which sends an item to its holding branch at checkin. To recreate: - Have 2+ branches - Set your default return policy to Item returns to issuing library - Find an item with holding branch of Branch A - Set your library to Branch B - Check item in - Koha generates a transfer to Branch A. In doing so, it sets the item holding branch to Branch B - Set your library to Branch A - Check item in - Koha generate a transfer to Branch B. In doing so, it sets the item holding branch to Branch A - Set you library to Branch A - Check the item in . . . Repeat indefinitely. It's easy enough to cancel a transfer to get out of this loop, but better not to get into it in the first place. That said, I'm not entirely sure how to avoid it. Can we somehow tell Koha that a checkin that ends a transfer should never start a new transfer? Unless there's a hold involved? -- 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=26078 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |23129 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23129 [Bug 23129] Items holdingbranch should be set to the originating library when generating a transfer -- 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=26078 Nick Clemens <nick@bywatersolutions.com> 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=26078 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 107597 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=107597&action=edit Bug 26078: Prevent generating a new transfer from return policy when resolving a transfer To test: - Have 2+ branches - Set your default return policy to Item returns to issuing library - Find an item with holding branch of Branch A - Set your library to Branch B - Check item in - Koha generates a transfer to Branch A. In doing so, it sets the item holding branch to Branch B - Set your library to Branch A - Check item in - Koha generate a transfer to Branch B. In doing so, it sets the item holding branch to Branch A - Set you library to Branch A - Check the item in . . . Repeat indefinitely. Apply patch Repeat No more loop -- 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=26078 ByWater Sandboxes <bws.sandboxes@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #107597|0 |1 is obsolete| | --- Comment #2 from ByWater Sandboxes <bws.sandboxes@gmail.com> --- Created attachment 107625 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=107625&action=edit Bug 26078: Prevent generating a new transfer from return policy when resolving a transfer To test: - Have 2+ branches - Set your default return policy to Item returns to issuing library - Find an item with holding branch of Branch A - Set your library to Branch B - Check item in - Koha generates a transfer to Branch A. In doing so, it sets the item holding branch to Branch B - Set your library to Branch A - Check item in - Koha generate a transfer to Branch B. In doing so, it sets the item holding branch to Branch A - Set you library to Branch A - Check the item in . . . Repeat indefinitely. Apply patch Repeat No more loop Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> -- 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=26078 Sally <sally.healey@cheshiresharedservices.gov.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sally.healey@cheshireshared | |services.gov.uk 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=26078 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | CC| |nick@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=26078 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #107625|0 |1 is obsolete| | --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 108188 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=108188&action=edit Bug 26078: Prevent generating a new transfer from return policy when resolving a transfer To test: - Have 2+ branches - Set your default return policy to Item returns to issuing library - Find an item with holding branch of Branch A - Set your library to Branch B - Check item in - Koha generates a transfer to Branch A. In doing so, it sets the item holding branch to Branch B - Set your library to Branch A - Check item in - Koha generate a transfer to Branch B. In doing so, it sets the item holding branch to Branch A - Set you library to Branch A - Check the item in . . . Repeat indefinitely. Apply patch Repeat No more loop Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26078 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |martin.renvoize@ptfs-europe | |.com --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Logic is sound, tests are added, works as expected. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26078 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26078 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- If I understand correctly, by modifying the return branch we actually want to not transfer. I'd suggest to use a meaningful separated bool variable. I noticed there is a $validTransfer variable that is not used, and its last used come from 0a64cfba5e10be80a220f6c8164905788ba5a78b where we have: - if ($doreturn and ($branch ne $hbr) and not $messages->{'WrongTransfer'} and ($validTransfert ne 1) ){ + if (($doreturn or $messages->{'NotIssued'}) and !$resfound and ($branch ne $hbr) and not $messages->{'WrongTransfer'}){ It seems that is was actually used for that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26078 --- Comment #6 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 108259 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=108259&action=edit Bug 26078: (follow-up) Use a boolean rather than changing returnbranch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26078 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- yes, that's the idea. However should not we unset validTransfer if WrongTransfer (and remove the test)? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26078 --- Comment #8 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 108278 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=108278&action=edit Bug 26078: (follow-up) used validTransfer instead of checking WrongTransfer message -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26078 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #108259|0 |1 is obsolete| | Attachment #108278|0 |1 is obsolete| | --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 108496 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=108496&action=edit Bug 26078: (follow-up) Use a boolean rather than changing returnbranch Bug 26078: (follow-up) used validTransfer instead of checking WrongTransfer message -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26078 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26078 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26078 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.11.00 |20.11.00, 20.05.03 released in| | Status|Pushed to master |Pushed to stable CC| |lucas@bywatersolutions.com --- Comment #11 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 20.05.x for 20.05.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26078 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.11.00, 20.05.03 |20.11.00, 20.05.03, released in| |19.11.10 CC| |aleisha@catalyst.net.nz Status|Pushed to stable |Pushed to oldstable --- Comment #12 from Aleisha Amohia <aleisha@catalyst.net.nz> --- backported to 19.11.x for 19.11.10 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26078 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net --- Comment #13 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Missing dependencies for 19.05.x, can't backport. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26078 --- Comment #14 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Dependencies ok now. Can't backport to 19.05.x: can't solve a conflict. If there is an interest in having this backported, feel free to submit a patch for 19.05. Conflict: # if we have a transfer to do, we update the line of transfers with the datearrived my $is_in_rotating_collection = C4::RotatingCollections::isItemInAnyCollection( $item->itemnumber ); if ($datesent) { if ( $tobranch eq $branch ) { my $sth = C4::Context->dbh->prepare( "UPDATE branchtransfers SET datearrived = now() WHERE itemnumber= ? AND datearrived IS NULL" ); $sth->execute( $item->itemnumber ); <<<<<<< HEAD # if we have a reservation with valid transfer, we can set it's status to 'W' C4::Reserves::ModReserveStatus($item->itemnumber, 'W'); ||||||| parent of 1b2eedbea9... Bug 26078: Prevent generating a new transfer from return policy when resolving a transfer ======= # If we are completing a transfer we should not generate a new transfer from return policy $returnbranch = $branch;
> 1b2eedbea9... Bug 26078: Prevent generating a new transfer from return policy when resolving a transfer } else { $messages->{'WrongTransfer'} = $tobranch; $messages->{'WrongTransferItem'} = $item->itemnumber; } $validTransfert = 1; }
# fix up the accounts..... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26078 Niamh Walker-Headon <Niamh.WalkerHeadon@hse.ie> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Niamh.WalkerHeadon@hse.ie -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26078 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=28520 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26078 jmbroust <jean-manuel.broust@univ-lyon2.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jean-manuel.broust@univ-lyo | |n2.fr -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org