From 161815ca68fa7f3dbd0fd1d0bee044d9a65b20ee Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 18 Apr 2024 10:35:52 +0000 Subject: [PATCH] Bug 36473: (follow-up) Add biblionumber to warning Signed-off-by: Katrin Fischer (cherry picked from commit 1b99de33f9e553f80507ef7da5e711b98e979e39) Signed-off-by: Fridolin Somers (cherry picked from commit bab05efd815d48ef0266454ec283bf7a8e19db45) Signed-off-by: Lucas Gass --- C4/Biblio.pm | 2 +- t/db_dependent/Biblio.t | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index e9c0cd8ce0..4c351a9e94 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -3038,7 +3038,7 @@ sub UpdateTotalIssues { if ($@) { my $exception = $@; $exception->rethrow unless ( $exception->isa('Koha::Exceptions::Metadata::Invalid') ); - warn "UpdateTotalIssues could not get bibliographic record"; + warn "UpdateTotalIssues could not get bibliographic record for biblionumber $biblionumber"; return; } my $biblioitem = $biblio->biblioitem; diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t index 28cdb78c10..c920d2a392 100755 --- a/t/db_dependent/Biblio.t +++ b/t/db_dependent/Biblio.t @@ -1029,6 +1029,7 @@ subtest 'UpdateTotalIssues on Invalid record' => sub { $return_record->mock( 'record', sub { Koha::Exceptions::Metadata::Invalid->throw() } ); my $biblio = $builder->build_sample_biblio; + my $biblionumber = $biblio->biblionumber; my $increase = 1; @@ -1036,7 +1037,7 @@ subtest 'UpdateTotalIssues on Invalid record' => sub { warning_is { $success = C4::Biblio::UpdateTotalIssues( $biblio->biblionumber, $increase, '' ); } - "UpdateTotalIssues could not get bibliographic record", "Expected warning found"; + "UpdateTotalIssues could not get bibliographic record for biblionumber $biblionumber", "Expected warning found"; ok( !$success, 'UpdateTotalIssues fails gracefully for invalid record' ); -- 2.39.5