Bugzilla – Attachment 110943 Details for
Bug 12556
SelfCheck machine starts the hold instantly with an email sent out
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12556: Refactor hold transfer status setting to its own method
Bug-12556-Refactor-hold-transfer-status-setting-to.patch (text/plain), 2.41 KB, created by
Timothy Alexis Vass
on 2020-09-30 07:59:05 UTC
(
hide
)
Description:
Bug 12556: Refactor hold transfer status setting to its own method
Filename:
MIME Type:
Creator:
Timothy Alexis Vass
Created:
2020-09-30 07:59:05 UTC
Size:
2.41 KB
patch
obsolete
>From e0c1f8d064b7b2f8b618a2172d66f3bc129f0240 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@helsinki.fi> >Date: Wed, 22 Jul 2020 15:44:31 +0000 >Subject: [PATCH] Bug 12556: Refactor hold transfer status setting to its own > method > >Signed-off-by: John Doe <you@example.com> >--- > C4/Reserves.pm | 6 ++++-- > Koha/Hold.pm | 21 +++++++++++++++------ > t/db_dependent/Hold.t | 2 +- > 3 files changed, 20 insertions(+), 9 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 2422d4facd..4690d97faf 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1161,9 +1161,9 @@ sub ModReserveAffect { > my $already_on_shelf = $hold->found && $hold->found eq 'W'; > > $hold->itemnumber($itemnumber); >- $hold->set_waiting($transferToDo); > > if( !$transferToDo ){ >+ $hold->set_waiting(); > _koha_notify_reserve( $hold->reserve_id ) unless $already_on_shelf; > my $transfers = Koha::Item::Transfers->search({ > itemnumber => $itemnumber, >@@ -1172,7 +1172,9 @@ sub ModReserveAffect { > while( my $transfer = $transfers->next ){ > $transfer->datearrived( dt_from_string() )->store; > }; >- } >+ } else { >+ $hold->set_transfer(); >+ } > > > _FixPriority( { biblionumber => $biblionumber } ); >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index 360b43e7b5..845028da97 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -153,20 +153,29 @@ sub delete { > return $deleted; > } > >+=head3 set_transfer >+ >+=cut >+ >+sub set_transfer { >+ my ( $self ) = @_; >+ >+ $self->priority(0); >+ $self->found('T'); >+ $self->store(); >+ >+ return $self; >+} >+ > =head3 set_waiting > > =cut > > sub set_waiting { >- my ( $self, $transferToDo ) = @_; >+ my ( $self ) = @_; > > $self->priority(0); > >- if ($transferToDo) { >- $self->found('T')->store(); >- return $self; >- } >- > my $today = dt_from_string(); > my $values = { > found => 'W', >diff --git a/t/db_dependent/Hold.t b/t/db_dependent/Hold.t >index dc588ded2b..d58b0a243c 100755 >--- a/t/db_dependent/Hold.t >+++ b/t/db_dependent/Hold.t >@@ -224,7 +224,7 @@ subtest 'suspend() tests' => sub { > is( $@->status, 'W', 'Exception gets the \'status\' parameter set correctly' ); > > # set hold found=T >- $hold->set_waiting(1); >+ $hold->set_transfer; > throws_ok > { $hold->suspend_hold; } > 'Koha::Exceptions::Hold::CannotSuspendFound', >-- >2.11.0
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 12556
:
107181
|
107182
|
107183
|
107184
|
107185
|
107186
|
108711
|
109140
|
109924
|
109925
|
109926
|
109927
|
109928
|
109929
|
110719
|
110942
|
110943
|
110944
|
110945
|
110946
|
110947
|
110948
|
110949
|
110950
|
110951
|
110952
|
110953
|
110954
|
110955
|
110956
|
110961
|
110962
|
110963
|
110964
|
110965
|
110966
|
111405
|
111406
|
111407
|
111408
|
111409
|
111410
|
111494
|
111495
|
111496
|
111497
|
111498
|
111499
|
111500
|
111509
|
111516
|
111585
|
111610