From bb626512f91f0eed42597f27c740d8cd54d6428b Mon Sep 17 00:00:00 2001 From: Jan Kissig Date: Fri, 6 Mar 2026 12:12:41 +0000 Subject: [PATCH] Bug 41147: (follow-up) Fix wrong record count Record_number gets increased every cycle before batch->next is called even when batch->next returns undef. This fix decreases record_number by 1 to ignore that last cycle in order to display the right number of records processed. --- misc/migration_tools/bulkmarcimport.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl index ea31c0b0b16..baa427cba70 100755 --- a/misc/migration_tools/bulkmarcimport.pl +++ b/misc/migration_tools/bulkmarcimport.pl @@ -721,6 +721,8 @@ RECORD: while () { print $record->as_formatted() . "\n" if ( $verbose // 0 ) == 2; } else { $records_exhausted = 1; + $record_number + --; # record_number was incremented even though $batch->next was empty, so it must be decremented by 1 } if ( !$test_parameter && $record_number % $commitnum == 0 || $record_number == $number || $records_exhausted ) { -- 2.39.5