Bug 36473: (follow-up) Add biblionumber to warning

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1b99de33f9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bab05efd81)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Nick Clemens 2024-04-18 10:35:52 +00:00 committed by Lucas Gass
parent db3e2e512d
commit 161815ca68
2 changed files with 3 additions and 2 deletions

View file

@ -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;

View file

@ -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' );