Bugzilla – Attachment 108188 Details for
Bug 26078
"Item returns to issuing library" creates infinite transfer loop
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26078: Prevent generating a new transfer from return policy when resolving a transfer
Bug-26078-Prevent-generating-a-new-transfer-from-r.patch (text/plain), 2.90 KB, created by
Martin Renvoize (ashimema)
on 2020-08-13 14:01:40 UTC
(
hide
)
Description:
Bug 26078: Prevent generating a new transfer from return policy when resolving a transfer
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-08-13 14:01:40 UTC
Size:
2.90 KB
patch
obsolete
>From 40582657da8a9fbfc0949f024b25956b1940a650 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 30 Jul 2020 16:59:14 +0000 >Subject: [PATCH] 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> >--- > C4/Circulation.pm | 3 +++ > t/db_dependent/Circulation/Branch.t | 8 +++++++- > 2 files changed, 10 insertions(+), 1 deletion(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index f530d92a72..7283ba4644 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2082,6 +2082,9 @@ sub AddReturn { > "UPDATE branchtransfers SET datearrived = now() WHERE itemnumber= ? AND datearrived IS NULL" > ); > $sth->execute( $item->itemnumber ); >+ >+ # If we are completing a transfer we should not generate a new transfer from return policy >+ $returnbranch = $branch; > } else { > $messages->{'WrongTransfer'} = $tobranch; > $messages->{'WrongTransferItem'} = $item->itemnumber; >diff --git a/t/db_dependent/Circulation/Branch.t b/t/db_dependent/Circulation/Branch.t >index 16e590fcc3..c8fe89dc97 100644 >--- a/t/db_dependent/Circulation/Branch.t >+++ b/t/db_dependent/Circulation/Branch.t >@@ -25,7 +25,7 @@ use Koha::CirculationRules; > > use Koha::Patrons; > >-use Test::More tests => 14; >+use Test::More tests => 15; > use t::lib::Mocks; > use t::lib::TestBuilder; > >@@ -303,6 +303,12 @@ $dbh->do( $query, {}, $borrower_id1, $item_id2, $samplebranch2->{branchcode} ); > $samplebranch2->{branchcode}); > is( $messages->{NeedsTransfer}, $samplebranch1->{branchcode}, "AddReturn respects branch return policy - item2->homebranch policy = 'holdingbranch'" ); > >+# Generate the transfer from above >+ModItemTransfer($item_id2, $samplebranch2->{branchcode}, $samplebranch1->{branchcode}, "ReturnToHolding"); >+# Fulfill it >+($doreturn, $messages, $iteminformation, $borrower) = AddReturn('barcode_2',$samplebranch1->{branchcode}); >+is( $messages->{NeedsTransfer}, undef, "AddReturn does not generate a new transfer for return policy when resolving an existing transfer" ); >+ > # item3 should not trigger transfer - floating collection > $query = > "INSERT INTO issues (borrowernumber,itemnumber,branchcode) VALUES( ?,?,? )"; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26078
:
107597
|
107625
| 108188 |
108259
|
108278
|
108496