Bug 41147

Summary: Counts in bulkmarcimport.pl are incorrect
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: Command-line UtilitiesAssignee: Nick Clemens (kidclamp) <nick>
Status: Failed QA --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: robin, roman.dolny
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 41147: Don't double count records

Description Nick Clemens (kidclamp) 2025-10-30 18:18:52 UTC
We are incrementing the record_number counter twice for every record
Comment 1 Nick Clemens (kidclamp) 2025-10-30 18:24:09 UTC
Created attachment 188705 [details] [review]
Bug 41147: Don't double count records

This patch prevents double counting records as we process them

To test:
1 - Export a single record from Koha in marcxml format
2 - perl misc/migration_tools/bulkmarcimport.pl -b -v -m MARCXML --file record.marcxml
3 - Note it says "3 MARC records processed"
4 - Apply patch
5 - Repeat
6 - 1 record processed
Comment 2 Roman Dolny 2025-12-20 09:08:11 UTC
Can confirm, that count of records processed after applying a patch is not doubled. But there is still +1 in count...

I tried with 1/2/4 records in file and get "2/3/5 MARC records done".