From 39e88fc1f77d3926e4beae7353c920098093d5b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Tue, 8 Jun 2021 07:50:29 +0000 Subject: [PATCH] Bug 28520: Revert "Bug 12362: Reverse transfer upon cancellation" This reverts commit d0407686eb070c5bdf0302147a198027abea5ac0. 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 --- Koha/Item/Transfer.pm | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/Koha/Item/Transfer.pm b/Koha/Item/Transfer.pm index 3fee987ae8..06588e01b1 100644 --- a/Koha/Item/Transfer.pm +++ b/Koha/Item/Transfer.pm @@ -18,7 +18,6 @@ package Koha::Item::Transfer; use Modern::Perl; use Carp; -use Try::Tiny; use C4::Items; @@ -162,24 +161,14 @@ sub cancel { error => "The 'reason' parameter is mandatory" ) unless defined($params->{reason}); - my $in_transit = $self->in_transit; - # Throw exception if item is in transit already - Koha::Exceptions::Item::Transfer::InTransit->throw() if ( !$params->{force} && $in_transit ); + Koha::Exceptions::Item::Transfer::InTransit->throw() if ( !$params->{force} && $self->in_transit ); # Update the cancelled date $self->set( { datecancelled => dt_from_string, cancellation_reason => $params->{reason} } ) ->store; - # Set up return transfer if transfer was force cancelled whilst in transit - # NOTE: We don't catch here, as we're happy to fail if there are already - # other transfers in the queue. - try { - $self->item->request_transfer( - { to => $self->from_library, reason => 'TransferCancellation' } ); - }; - return $self; } -- 2.39.5