Bugzilla – Attachment 110457 Details for
Bug 25265
Elasticsearch - Batch editing items on a biblio can lead to incorrect index
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18958: (follow-up) Ensure hold fill target reserve_id is set for all hold types
Bug-18958-follow-up-Ensure-hold-fill-target-reserv.patch (text/plain), 4.95 KB, created by
Kyle M Hall (khall)
on 2020-09-21 12:41:04 UTC
(
hide
)
Description:
Bug 18958: (follow-up) Ensure hold fill target reserve_id is set for all hold types
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-09-21 12:41:04 UTC
Size:
4.95 KB
patch
obsolete
>From 6dfb21cf11bf4da610285fbd171fd7bf94ed5239 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 25 Aug 2020 10:35:02 +0000 >Subject: [PATCH] Bug 18958: (follow-up) Ensure hold fill target reserve_id is > set for all hold types > >MapItemsToHoldRequests has three sections: Local holds, item level holds, bib level holds > >Only one of them was setting the reserve_id. This patch makes al three set it and adds tests > >To test: >1 - Repeat test plan on bug >2 - sudo koha-mysql kohadev > SELECT * FROM hold_fill_targets >3 - Ensure reserve_id is set at appropriate times >4 - prove -v t/db_dependent/HoldsQueue.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Bug 18958: (QA follow-up) Fix number of tests > >In HoldsQueue.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >https://bugs.koha-community.org/show_bug.cgi?id=25265 >--- > C4/HoldsQueue.pm | 2 ++ > t/db_dependent/HoldsQueue.t | 12 +++++++++--- > 2 files changed, 11 insertions(+), 3 deletions(-) > >diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm >index 08f8a4eb94..b891afc437 100644 >--- a/C4/HoldsQueue.pm >+++ b/C4/HoldsQueue.pm >@@ -481,6 +481,7 @@ sub MapItemsToHoldRequests { > biblionumber => $request->{biblionumber}, > holdingbranch => $items_by_itemnumber{ $request->{itemnumber} }->{holdingbranch}, > pickup_branch => $request->{branchcode} || $request->{borrowerbranch}, >+ reserve_id => $request->{reserve_id}, > item_level => $request->{item_level_hold}, > reservedate => $request->{reservedate}, > reservenotes => $request->{reservenotes}, >@@ -656,6 +657,7 @@ sub MapItemsToHoldRequests { > biblionumber => $request->{biblionumber}, > holdingbranch => $holdingbranch, > pickup_branch => $pickup_branch, >+ reserve_id => $request->{reserve_id}, > item_level => $request->{item_level_hold}, > reservedate => $request->{reservedate}, > reservenotes => $request->{reservenotes}, >diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t >index 518f6d3fb4..06047c647f 100755 >--- a/t/db_dependent/HoldsQueue.t >+++ b/t/db_dependent/HoldsQueue.t >@@ -8,7 +8,7 @@ > > use Modern::Perl; > >-use Test::More tests => 54; >+use Test::More tests => 55; > use Data::Dumper; > > use C4::Calendar; >@@ -669,6 +669,8 @@ $reserve_id = AddReserve( > C4::HoldsQueue::CreateQueue(); > $holds_queue = $dbh->selectall_arrayref( "SELECT * FROM tmp_holdsqueue", { Slice => {} } ); > is( @$holds_queue, 1, "Hold where pickup branch matches home branch targeted" ); >+my $target_rs = $schema->resultset('HoldFillTarget'); >+is( $target_rs->next->reserve_id, $reserve_id, "Reserve id correctly set in hold fill target for title level hold" ); > Koha::Holds->find( $reserve_id )->cancel; > > # Holding branch matches pickup branch >@@ -915,7 +917,7 @@ Koha::Holds->find( $reserve_id )->cancel; > > > subtest "Test Local Holds Priority - Bib level" => sub { >- plan tests => 2; >+ plan tests => 3; > > Koha::Biblios->delete(); > t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 1 ); >@@ -971,6 +973,7 @@ subtest "Test Local Holds Priority - Bib level" => sub { > C4::HoldsQueue::CreateQueue(); > > my $queue_rs = $schema->resultset('TmpHoldsqueue'); >+ my $target_rs = $schema->resultset('HoldFillTarget'); > is( $queue_rs->count(), 1, > "Hold queue contains one hold" ); > is( >@@ -978,6 +981,7 @@ subtest "Test Local Holds Priority - Bib level" => sub { > $local_patron->borrowernumber, > "We should pick the local hold over the next available" > ); >+ is( $target_rs->next->reserve_id, $reserve_id2, "Reserve id correctly set in hold fill target" ); > }; > > subtest "Test Local Holds Priority - Item level" => sub { >@@ -1263,7 +1267,7 @@ subtest "Test Local Holds Priority - Ensure no duplicate requests in holds queue > > subtest "Item level holds info is preserved (Bug 25738)" => sub { > >- plan tests => 3; >+ plan tests => 4; > > $dbh->do("DELETE FROM tmp_holdsqueue"); > $dbh->do("DELETE FROM hold_fill_targets"); >@@ -1336,6 +1340,8 @@ subtest "Item level holds info is preserved (Bug 25738)" => sub { > > my $queue_line_1 = $queue_rs->next; > is( $queue_line_1->item_level_request, 1, 'Request is correctly advertised as item-level' ); >+ my $target_rs = $schema->resultset('HoldFillTarget')->search({borrowernumber=>$patron_1->borrowernumber});; >+ is( $target_rs->next->reserve_id, $reserve_id_1, "Reserve id correctly set in hold fill target for item level hold" ); > > my $queue_line_2 = $queue_rs->next; > is( $queue_line_2->item_level_request, 0, 'Request is correctly advertised as biblio-level' ); >-- >2.24.1 (Apple Git-126)
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 25265
:
107832
|
107855
|
107867
|
109538
|
109556
|
110262
|
110263
|
110264
|
110380
|
110381
|
110382
|
110457
|
110458
|
110459
|
110560
|
110561
|
110562
|
110565
|
110594
|
110595
|
110596
|
110597
|
110615
|
110618
|
110729
|
110730
|
110731
|
110732
|
110733
|
110734
|
110736
|
110737
|
110882
|
110883
|
110937