Bugzilla – Attachment 160215 Details for
Bug 35587
Items lose their lost status when check-in triggers a transfer even though BlockReturnOfLostItems is enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35587: Do not trigger transfer if lost item returned and BlockReturnOfLostItems enabled
Bug-35587-Do-not-trigger-transfer-if-lost-item-ret.patch (text/plain), 3.40 KB, created by
ByWater Sandboxes
on 2023-12-21 18:30:14 UTC
(
hide
)
Description:
Bug 35587: Do not trigger transfer if lost item returned and BlockReturnOfLostItems enabled
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2023-12-21 18:30:14 UTC
Size:
3.40 KB
patch
obsolete
>From edc4b21cce4dbb484d1d94f62c2ef1f57e32d7b7 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 20 Dec 2023 02:37:48 +0000 >Subject: [PATCH] Bug 35587: Do not trigger transfer if lost item returned and > BlockReturnOfLostItems enabled > >This fixes current buggy behaviour - when BlockReturnOfLostItems is enabled, no transfer should be triggered and the lost status should be retained. > >To test: > >1. Go to Koha Administration -> Global system preferences >2. Set the BlockReturnOfLostItems system preference to Block >3. Enable the AutomaticItemReturn system preference (this is simply to make testing a bit faster) >4. Take note of your logged in library >5. Search for an item where the home library is NOT the same as your logged in library >6. Edit this item and give it a lost status >7. Check in the item >8. Notice the item is returned and a transfer is automatically triggered >9. If you go to the item record page, the lost status has been remove > >10. Apply the patch and restart services > >11. Edit the item again and give it a lost status. This will also cancel the transfer >12. Check in the item >13. Confirm the transfer is NOT triggered and the lost status is retained as expected. >14. Go back to system preferences and disable the BlockReturnOfLostItems system preference (set to "Don't block") >15. Check in the item >16. Confirm the transfer is triggered and lost status is removed > >17. Confirm tests pass > >prove t/db_dependent/Circulation/Returns.t > >Sponsored-by: Pymble Ladies' College >Signed-off-by: Esther <esther@bywatersolutions.com> >--- > C4/Circulation.pm | 3 ++- > t/db_dependent/Circulation/Returns.t | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 562cad7267..759f52de5d 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2522,7 +2522,8 @@ sub AddReturn { > and not $messages->{'WrongTransfer'} > and not $messages->{'WasTransfered'} > and not $messages->{TransferredRecall} >- and not $messages->{RecallNeedsTransfer} ) >+ and not $messages->{RecallNeedsTransfer} >+ and ( $messages->{WasLost} and !C4::Context->preference('BlockReturnOfLostItems') ) ) > { > my $BranchTransferLimitsType = C4::Context->preference("BranchTransferLimitsType") eq 'itemtype' ? 'effective_itemtype' : 'ccode'; > if (C4::Context->preference("AutomaticItemReturn" ) or >diff --git a/t/db_dependent/Circulation/Returns.t b/t/db_dependent/Circulation/Returns.t >index db25fda549..6d3069df45 100755 >--- a/t/db_dependent/Circulation/Returns.t >+++ b/t/db_dependent/Circulation/Returns.t >@@ -286,7 +286,7 @@ subtest 'Handle ids duplication' => sub { > }; > > subtest 'BlockReturnOfLostItems' => sub { >- plan tests => 4; >+ plan tests => 5; > my $item = $builder->build_sample_item; > my $patron = $builder->build_object({ class => 'Koha::Patrons' }); > my $checkout = AddIssue( $patron, $item->barcode ); >@@ -298,6 +298,7 @@ subtest 'BlockReturnOfLostItems' => sub { > my ( $doreturn, $messages, $issue ) = AddReturn($item->barcode); > is( $doreturn, 0, "With BlockReturnOfLostItems, a checkin of a lost item should be blocked"); > is( $messages->{WasLost}, 1, "... and the WasLost flag should be set"); >+ is( $messages->{NeedsTransfer}, undef, "... and no transfer should be triggered"); > > $item->discard_changes; > is( $item->itemlost, 1, "Item remains lost" ); >-- >2.30.2
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 35587
:
160093
|
160215
|
160305
|
160323
|
160396
|
160397
|
160398
|
160399