Bugzilla – Attachment 181575 Details for
Bug 39750
Wrong transfer breaking check in when using library transfer limits
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39750: Ignore limits when updating WrongTransfer
Bug-39750-Ignore-limits-when-updating-WrongTransfe.patch (text/plain), 2.14 KB, created by
Martin Renvoize (ashimema)
on 2025-04-28 06:45:48 UTC
(
hide
)
Description:
Bug 39750: Ignore limits when updating WrongTransfer
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-04-28 06:45:48 UTC
Size:
2.14 KB
patch
obsolete
>From 57d1765c7e3823df52d15a4afef58b02ff95d625 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 25 Apr 2025 16:21:43 +0000 >Subject: [PATCH] Bug 39750: Ignore limits when updating WrongTransfer > >This patch ignores limits when updating a wrong transfer to ensure we can return a book >home when checked in at the wrong branch > >To test: >1 - Enable UseBranchTransferLimits based on 'Collection code' >2 - Disable transfers for FIC from: > CPL -> FFL > CPL -> IPT > FFL -> CPL > FFL -> IPT > IPT -> CPL > IPT -> FFL >3 - Set library to IPT >4 - Checkin an FFL item >5 - It generates a transfer home >6 - Set library to CPL >7 - Check the item in >8 - 500 error, and in logs: > ==> /var/log/koha/kohadev/plack-error.log <== >Exception 'Koha::Exceptions::Item::Transfer::Limit' thrown 'Transfer not allowed' >9 - Apply patch, restart all >10 - Check item in again >11 - Success! Transfer updated > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > circ/returns.pl | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > >diff --git a/circ/returns.pl b/circ/returns.pl >index c9c89593a82..a40146ac641 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -549,8 +549,17 @@ if ( $messages->{'WrongTransfer'} and not $messages->{'WasTransfered'} ) { > # Update the transfer to reflect the new item holdingbranch > my $item = Koha::Items->find( $messages->{'WrongTransferItem'} ); > my $old_transfer = $item->get_transfer; >+ >+ # We need to ignore limits here. While we can't transfer from this branch, it is, wrongly, here right now >+ # and that fact must be recorded > my $new_transfer = $item->request_transfer( >- { to => $old_transfer->to_library, reason => $old_transfer->reason, replace => 'WrongTransfer' } ); >+ { >+ to => $old_transfer->to_library, >+ reason => $old_transfer->reason, >+ replace => 'WrongTransfer', >+ ignore_limits => 1 >+ } >+ ); > $template->param( NewTransfer => $new_transfer->id ); > > my $reserve = $messages->{'ResFound'}; >-- >2.49.0
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 39750
:
181547
|
181557
| 181575