Bugzilla – Attachment 121078 Details for
Bug 28294
C4::Circulation::updateWrongTransfer should be moved into Koha::
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28294: Pass 'replace' through to Koha::Item::Transfer->cancel
Bug-28294-Pass-replace-through-to-KohaItemTransfer.patch (text/plain), 1.80 KB, created by
Victor Grousset/tuxayo
on 2021-05-17 23:25:25 UTC
(
hide
)
Description:
Bug 28294: Pass 'replace' through to Koha::Item::Transfer->cancel
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2021-05-17 23:25:25 UTC
Size:
1.80 KB
patch
obsolete
>From 98e083cfcd4e4a44302a1a91ef9e6bda24710180 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 6 May 2021 16:31:39 +0100 >Subject: [PATCH] Bug 28294: Pass 'replace' through to > Koha::Item::Transfer->cancel > >The `replace` option found in Koha::Item->request_transfer should be >passed through to Koha::Item::Transfer->cancel and prevent any reverse >transfers from being queued in such cases. > >This allows us to replace updateWrongTransfer entirely with >Koha::Item->request_transfer with the 'replace' parameter enabled. > >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > Koha/Item.pm | 2 +- > Koha/Item/Transfer.pm | 3 ++- > 2 files changed, 3 insertions(+), 2 deletions(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 2bad020287..730a73bc8d 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -467,7 +467,7 @@ sub request_transfer { > } > )->store(); > >- $request->cancel( { reason => $params->{reason}, force => 1 } ) >+ $request->cancel( { reason => $params->{reason}, force => 1, replace => 1 } ) > if ( defined($request) && $params->{replace} ); > > return $transfer; >diff --git a/Koha/Item/Transfer.pm b/Koha/Item/Transfer.pm >index d5602a9ba7..59387d4415 100644 >--- a/Koha/Item/Transfer.pm >+++ b/Koha/Item/Transfer.pm >@@ -173,9 +173,10 @@ sub cancel { > ->store; > > # Set up return transfer if transfer was force cancelled whilst in transit >+ # and we were not notified that the transfer is being replaced. > # NOTE: We don't catch here, as we're happy to fail if there are already > # other transfers in the queue. >- if ($in_transit) { >+ if ($in_transit && !$params->{replace}) { > try { > $self->item->request_transfer( > { to => $self->from_library, reason => 'TransferCancellation' } ); >-- >2.31.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 28294
:
120637
|
121062
|
121063
|
121064
|
121077
|
121078
|
121079
|
121095
|
121096
|
121097
|
121714
|
121715
|
121716
|
130082
|
130083
|
130084
|
130085
|
130086
|
130087
|
132212
|
132213
|
132214
|
132215
|
132216
|
132217
|
160516
|
160517
|
160518
|
160519
|
160520
|
160521
|
160536
|
160692
|
168281
|
172778
|
172781
|
173856
|
174805