Bugzilla – Attachment 107181 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.37 KB, created by
Joonas Kylmälä
on 2020-07-22 15:50:12 UTC
(
hide
)
Description:
Bug 12556: Refactor hold transfer status setting to its own method
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2020-07-22 15:50:12 UTC
Size:
2.37 KB
patch
obsolete
>From 01596aba0293caeb45f9ccb7b17bfcae65536b0e 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 > >--- > 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 979b3de244..c6224c702b 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1153,9 +1153,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, >@@ -1164,7 +1164,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 8969e32839..4c57b7cb2f 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -151,20 +151,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