From e98ce2c1fb1192c41d402c4014e86938eedf8f00 Mon Sep 17 00:00:00 2001 From: =?utf8?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. Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- Koha/Item.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Koha/Item.pm b/Koha/Item.pm index 730a73bc8d..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, replace => 1 } ) - if ( defined($request) && $params->{replace} ); - return $transfer; } -- 2.39.5