From c277de2e709569df23d2132ec99122fe4e4d3d9b Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 23 Jul 2026 19:16:28 +0000 Subject: [PATCH] Bug 43168: Check if there are errors, not if variable defined $errors is an array ref returned from a blank array variable if( $errors ){ #this will be true if( scalar @$errors ){ #only true when array has members To test: 1 - tail -f /var/log/koha/kohadev/intranet-error.log 2 - Stage a marc file 3 - Note the error: ==> /var/log/koha/kohadev/intranet-error.log <== [2026/07/23 19:11:37] [WARN] The following error(s) occurred during ISO2709 record import: ERROR: Koha::ImportBatch::try {...} /kohadevbox/koha/Koha/ImportBatch.pm (105) 4 - Apply patch 5 - Restart all 6 - Stage a file 7 - No error! Signed-off-by: Jonathan Druart Signed-off-by: Lucas Gass --- Koha/ImportBatch.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/ImportBatch.pm b/Koha/ImportBatch.pm index eb1037d8af..f8f3172c8d 100644 --- a/Koha/ImportBatch.pm +++ b/Koha/ImportBatch.pm @@ -102,7 +102,7 @@ sub new_from_file { ); } - if ($errors) { + if ( scalar @$errors ) { Koha::Logger->get->warn( 'The following error(s) occurred during ' . ( defined $format ? ( $format . " " ) : "" ) . "record import:\nERROR: "