From 9fc9dd9e54cd1f0f9fb0b806ac5de02695466678 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Thu, 16 Oct 2025 20:16:58 +0300 Subject: [PATCH] Bug 41036: Log errors in Koha::ImportBatch->new_from_file To test: 1. prove t/db_dependent/Koha/ImportBatch.t 2. Observe success --- Koha/ImportBatch.pm | 7 +++++++ t/db_dependent/Koha/ImportBatch.t | 0 2 files changed, 7 insertions(+) mode change 100644 => 100755 t/db_dependent/Koha/ImportBatch.t diff --git a/Koha/ImportBatch.pm b/Koha/ImportBatch.pm index 1d88fc68d16..eb1037d8afc 100644 --- a/Koha/ImportBatch.pm +++ b/Koha/ImportBatch.pm @@ -102,6 +102,13 @@ sub new_from_file { ); } + if ($errors) { + Koha::Logger->get->warn( 'The following error(s) occurred during ' + . ( defined $format ? ( $format . " " ) : "" ) + . "record import:\nERROR: " + . join( "\nERROR: ", @$errors ) ); + } + $job->size( scalar @$marcrecords )->store if $job; ( $batch_id, $num_valid, $num_items, @import_errors ) = BatchStageMarcRecords( diff --git a/t/db_dependent/Koha/ImportBatch.t b/t/db_dependent/Koha/ImportBatch.t old mode 100644 new mode 100755 -- 2.34.1