From ca179e808f00b0fe08f0fa9c377c10096da0702c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 28 Oct 2021 12:03:58 +0200 Subject: [PATCH] Bug 28445: Fix LostItem call and display errors Never a try without a catch, ever! Signed-off-by: Jonathan Druart --- Koha/Items.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Koha/Items.pm b/Koha/Items.pm index d0c67e1db0..0730935a0b 100644 --- a/Koha/Items.pm +++ b/Koha/Items.pm @@ -24,6 +24,7 @@ use Try::Tiny; use C4::Context; use C4::Biblio qw( GetMarcStructure GetMarcFromKohaField ); +use C4::Circulation; use Koha::Database; use Koha::SearchEngine::Indexer; @@ -328,7 +329,7 @@ sub batch_update { my $itemlost_pre = $item->itemlost; $item->set($new_values)->store({skip_record_index => 1}); - LostItem( + C4::Circulation::LostItem( $item->itemnumber, 'batchmod', undef, { skip_record_index => 1 } ) if $item->itemlost @@ -337,7 +338,10 @@ sub batch_update { push @modified_itemnumbers, $item->itemnumber if $modified || $modified_holds_priority; $modified_fields += $modified + $modified_holds_priority; - })}; + })} + catch { + warn $_ + }; if ( $callback ) { $callback->(++$i); -- 2.39.5