From 0d3156c826535394259dd5ba6c29fd6f65f39311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?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 --- 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 448e68cfff..96e652df28 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; @@ -134,24 +133,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.11.0