Bugzilla – Attachment 121693 Details for
Bug 28520
Cancelling a hold that is in transit hides item's transit status
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28520: Create cancelled hold's transfer back after previous transfer finishes
Bug-28520-Create-cancelled-holds-transfer-back-aft.patch (text/plain), 2.88 KB, created by
Joonas Kylmälä
on 2021-06-07 18:56:10 UTC
(
hide
)
Description:
Bug 28520: Create cancelled hold's transfer back after previous transfer finishes
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2021-06-07 18:56:10 UTC
Size:
2.88 KB
patch
obsolete
>From cda860678561decd12dea6f981aefcbb991cab7f Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@helsinki.fi> >Date: Mon, 7 Jun 2021 21:49:21 +0300 >Subject: [PATCH] Bug 28520: Create cancelled hold's transfer back after > previous transfer finishes > >This fixes regression caused by "Bug 12362: Cancel transfer with hold >cancelation" where cancelled hold's transfer didn't show up in >intranet and opac because it create a new transfer that was not yet >put in in-transit state. The original idea of bug 12362 was to be able >to trigger transfer back home if a hold was cancelled. We can do it >more simply by setting the $validTransfer variable true in the item >check-in code when we are dealing with Reserve transfers. > >To test: > 1) Apply patch > 1) Have biblio with item in branch A > 2) Create a new hold with a pickup library to branch B > 3) Check-in the item at branch A and confirm the hold and transfer > 4) Cancel the hold > 5) Check-in the hold at branch B and notice it prompt to return it to > branch A >--- > C4/Circulation.pm | 2 ++ > Koha/Hold.pm | 8 -------- > 2 files changed, 2 insertions(+), 8 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 10db0d226a..de1d77595f 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2171,6 +2171,7 @@ sub AddReturn { > if ( $transfer->tobranch eq $branch ) { > $transfer->receive; > $messages->{'TransferArrived'} = $transfer->frombranch; >+ $validTransfer = 1 if $transfer->reason eq 'Reserve'; > } > else { > $messages->{'WrongTransfer'} = $transfer->tobranch; >@@ -2181,6 +2182,7 @@ sub AddReturn { > if ( $transfer->tobranch eq $branch ) { > $transfer->receive; > $messages->{'TransferArrived'} = $transfer->frombranch; >+ $validTransfer = 1 if $transfer->reason eq 'Reserve'; > } > else { > $messages->{'WasTransfered'} = $transfer->tobranch; >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index 2bdae269ec..cefc3ed666 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -514,14 +514,6 @@ sub cancel { > > $self->_result->result_source->schema->txn_do( > sub { >- if ( $self->is_in_transit ) { >- my $transfer = $self->item->get_transfer; >- # NOTE: Transfers are well bound with Holds.. as such we have to check that there is actually a >- # transfer enqueued and in transit here prior to trying to cancel it. >- if ( $transfer && $transfer->in_transit ) { >- $transfer->cancel({ reason => 'CancelReserve', force => 1 }); >- } >- } > $self->cancellationdate( dt_from_string->strftime( '%Y-%m-%d %H:%M:%S' ) ); > $self->priority(0); > $self->cancellation_reason( $params->{cancellation_reason} ); >-- >2.25.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 28520
:
121686
|
121689
|
121690
|
121691
|
121693
|
121708
|
121709
|
121710
|
121711
|
121712
|
121718
|
121719
|
121720
|
121721
|
121722
|
121843
|
121844
|
121845
|
121846
|
121847
|
121951
|
121952
|
121953
|
121954
|
121955
|
121985
|
122005
|
122006
|
122007