Bugzilla – Attachment 151507 Details for
Bug 33791
$hold->fill does not set itemnumber when checking out without confirming hold
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33791: Pass itemnumber to $hold->fill
Bug-33791-Pass-itemnumber-to-hold-fill.patch (text/plain), 2.15 KB, created by
Marcel de Rooy
on 2023-05-22 11:23:27 UTC
(
hide
)
Description:
Bug 33791: Pass itemnumber to $hold->fill
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-05-22 11:23:27 UTC
Size:
2.15 KB
patch
obsolete
>From 2a6bd71c44779804eb19057665f75923b6c9a78f Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 22 May 2023 11:14:25 +0000 >Subject: [PATCH] Bug 33791: Pass itemnumber to $hold->fill >Content-Type: text/plain; charset=utf-8 > >Test plan: >Without this patch: >Place next available level on some book for patron A. >Checkout this book directly to patron A. >Check old_reserves table for this reserve; does not have itemnumber. >With this patch: >Do the same. >In old_reserves the itemnumber should be saved. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Reserves.pm | 4 ++-- > Koha/Hold.pm | 4 +++- > 2 files changed, 5 insertions(+), 3 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 8e64605a45..6995399002 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -2022,7 +2022,7 @@ sub MoveReserve { > > if ($res->{borrowernumber} == $borrowernumber) { > my $hold = Koha::Holds->find( $res->{reserve_id} ); >- $hold->fill; >+ $hold->fill({ itemnumber => $itemnumber }); > } > else { > # warn "Reserved"; >@@ -2038,7 +2038,7 @@ sub MoveReserve { > > if ( $borr_res ) { > # The item is reserved by the current patron >- $borr_res->fill; >+ $borr_res->fill({ itemnumber => $itemnumber }); > } > > if ( $cancelreserve eq 'revert' ) { ## Revert waiting reserve to priority 1 >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index ad9560ff39..e40734fed1 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -777,13 +777,14 @@ sub cancel { > =head3 fill > > $hold->fill; >+ $hold->fill({ itemnumber => $i }); # optional itemnumber: see MoveReserves > > This method marks the hold as filled. It effectively moves it to old_reserves. > > =cut > > sub fill { >- my ( $self ) = @_; >+ my ( $self, $params ) = @_; > $self->_result->result_source->schema->txn_do( > sub { > my $patron = $self->patron; >@@ -792,6 +793,7 @@ sub fill { > { > found => 'F', > priority => 0, >+ $params->{itemnumber} ? ( itemnumber => $params->{itemnumber} ) : (), > } > ); > >-- >2.30.2
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 33791
:
151507
|
151508
|
151509
|
151524
|
151525
|
151526
|
151527
|
151539