Bugzilla – Attachment 151539 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: (QA follow-up) Stick to 'item_id' for the parameter name
Bug-33791-QA-follow-up-Stick-to-itemid-for-the-par.patch (text/plain), 3.03 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-05-22 17:45:17 UTC
(
hide
)
Description:
Bug 33791: (QA follow-up) Stick to 'item_id' for the parameter name
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-05-22 17:45:17 UTC
Size:
3.03 KB
patch
obsolete
>From c786f66f01ecccf0946e6353a3812e6142733594 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 22 May 2023 11:47:41 -0300 >Subject: [PATCH] Bug 33791: (QA follow-up) Stick to 'item_id' for the > parameter name > >--- > C4/Reserves.pm | 4 ++-- > Koha/Hold.pm | 7 ++++--- > t/db_dependent/Koha/Hold.t | 4 ++-- > 3 files changed, 8 insertions(+), 7 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 69953990020..51172200aba 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({ itemnumber => $itemnumber }); >+ $hold->fill({ item_id => $itemnumber }); > } > else { > # warn "Reserved"; >@@ -2038,7 +2038,7 @@ sub MoveReserve { > > if ( $borr_res ) { > # The item is reserved by the current patron >- $borr_res->fill({ itemnumber => $itemnumber }); >+ $borr_res->fill({ item_id => $itemnumber }); > } > > if ( $cancelreserve eq 'revert' ) { ## Revert waiting reserve to priority 1 >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index e40734fed14..e2bdb0425f5 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -776,10 +776,11 @@ sub cancel { > > =head3 fill > >- $hold->fill; >- $hold->fill({ itemnumber => $i }); # optional itemnumber: see MoveReserves >+ $hold->fill({ [ item_id => $item->id ] }); > > This method marks the hold as filled. It effectively moves it to old_reserves. >+The optional I<item_id> parameter is used to set the information about the >+item that filled the hold. > > =cut > >@@ -793,7 +794,7 @@ sub fill { > { > found => 'F', > priority => 0, >- $params->{itemnumber} ? ( itemnumber => $params->{itemnumber} ) : (), >+ $params->{item_id} ? ( itemnumber => $params->{item_id} ) : (), > } > ); > >diff --git a/t/db_dependent/Koha/Hold.t b/t/db_dependent/Koha/Hold.t >index 58f3fc45ebd..5fc1646d35a 100755 >--- a/t/db_dependent/Koha/Hold.t >+++ b/t/db_dependent/Koha/Hold.t >@@ -124,12 +124,12 @@ subtest 'fill() tests' => sub { > is( $old_hold->priority, 0, 'priority set to 0' ); > is( $old_hold->found, 'F', 'found set to F' ); > >- subtest 'itemnumber parameter' => sub { >+ subtest 'item_id parameter' => sub { > plan tests => 1; > $category->reservefee(0)->store; # do not disturb later accounts > $hold = $builder->build_object({ class => 'Koha::Holds', value => { biblionumber => $biblio->id, borrowernumber => $patron->id, itemnumber => undef, priority => 1 } }); > # Simulating checkout without confirming hold >- $hold->fill({ itemnumber => $item->id }); >+ $hold->fill({ item_id => $item->id }); > $old_hold = Koha::Old::Holds->find($hold->id); > is( $old_hold->itemnumber, $item->itemnumber, 'The itemnumber has been saved in old_reserves by fill' ); > $old_hold->delete; >-- >2.34.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 33791
:
151507
|
151508
|
151509
|
151524
|
151525
|
151526
|
151527
| 151539