Bugzilla – Attachment 194183 Details for
Bug 41880
Logs for moved holds don't indicate original bib number/item number
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41880: Add a unit test for item level holds logging
Bug-41880-Add-a-unit-test-for-item-level-holds-log.patch (text/plain), 2.01 KB, created by
Lucas Gass (lukeg)
on 2026-02-27 20:59:08 UTC
(
hide
)
Description:
Bug 41880: Add a unit test for item level holds logging
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2026-02-27 20:59:08 UTC
Size:
2.01 KB
patch
obsolete
>From d5007fe2d8a602b3419881a3a94a98c7477c8e5f Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 27 Feb 2026 20:49:25 +0000 >Subject: [PATCH] Bug 41880: Add a unit test for item level holds logging > >--- > t/db_dependent/Koha/Hold.t | 33 ++++++++++++++++++++++++++++++++- > 1 file changed, 32 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Hold.t b/t/db_dependent/Koha/Hold.t >index 8249ec72278..00fd7512bdb 100755 >--- a/t/db_dependent/Koha/Hold.t >+++ b/t/db_dependent/Koha/Hold.t >@@ -1746,7 +1746,7 @@ subtest 'revert_found() tests' => sub { > }; > }; > subtest 'move_hold() tests' => sub { >- plan tests => 16; >+ plan tests => 21; > $schema->storage->txn_begin; > > my $patron = Koha::Patron->new( >@@ -1902,6 +1902,37 @@ subtest 'move_hold() tests' => sub { > 'diff column contains undef itemnumber because this is a record level move' > ); > >+ $hold->move_hold( { new_itemnumber => $item_3->itemnumber } ); >+ $hold->discard_changes; >+ >+ my $logs_3 = Koha::ActionLogs->search( >+ { >+ action => 'MODIFY', >+ module => 'HOLDS', >+ object => $hold->id >+ } >+ ); >+ >+ is( $logs_3->count, 1, 'Item level hold modification was logged' ); >+ >+ my $diff_3 = decode_json( $logs_3->next->diff ); >+ is( >+ $diff_3->{D}->{itemnumber}->{O}, $item_2->itemnumber, >+ 'diff column for Old (O) contains original itemnumber for item level move' >+ ); >+ is( >+ $diff_3->{D}->{itemnumber}->{N}, $item_3->itemnumber, >+ 'diff column for New (N) contains new itemnumber for item level move' >+ ); >+ is( >+ $diff_3->{D}->{biblionumber}->{O}, $biblio2->biblionumber, >+ 'diff column for Old (O) contains original biblionumber for item level move' >+ ); >+ is( >+ $diff_3->{D}->{biblionumber}->{N}, $biblio3->biblionumber, >+ 'diff column for New (N) contains new biblionumber for item level move' >+ ); >+ > #disable HoldsLog > t::lib::Mocks::mock_preference( 'HoldsLog', 0 ); > >-- >2.39.5
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 41880
:
194039
|
194040
|
194181
|
194182
|
194183
|
194188
|
194189
|
194190