From 92510dabb58010166dc80907105234d9f6636bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Tue, 8 Jun 2021 07:47:32 +0000 Subject: [PATCH] Bug 28520: Revert "Bug 12362: (QA follow-up) Fix ModItemTransfer cancellation handling" This reverts commit fbba09f63f200d3e57a8612554984d807867cf84. This commit was part of a series adding adding reverse transfers, i.e. transfers that were created for transfers that were cancelled and we wanted the item to return back to its sending library. This however hid the information about transfer happening and we need another approach to the problem. --- Koha/Item.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Koha/Item.pm b/Koha/Item.pm index 2bad020287..47a86eb0bb 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -456,6 +456,9 @@ sub request_transfer { Koha::Exceptions::Item::Transfer::InQueue->throw( transfer => $request ) if ( $request && !$params->{enqueue} && !$params->{replace} ); + $request->cancel( { reason => $params->{reason}, force => 1 } ) + if ( defined($request) && $params->{replace} ); + my $transfer = Koha::Item::Transfer->new( { itemnumber => $self->itemnumber, @@ -467,9 +470,6 @@ sub request_transfer { } )->store(); - $request->cancel( { reason => $params->{reason}, force => 1 } ) - if ( defined($request) && $params->{replace} ); - return $transfer; } -- 2.25.1