Koha-clms/misc
Jan Kissig a859898aba
Bug 41681: (follow-up) Fix record number count when broken records are processed
When running the script bulkmarcimport.pl, the number of MARC records reported at the end of the execution does not match the actual number of records processed from the input file.

This patch fixes 3 issues
- broken (invalid) records from batch get now counted (record_number)
- when using the number param (n) to limit the number of records to be processed valid and invalid records get counted
- when using th offset param (o) the scipt errored when broken records were part of the offset.

To test:

1. Download the MARC file with the broken record
2. Run the following import commands and compare the counted import numbers:
  a) all records
     perl misc/migration_tools/bulkmarcimport.pl -b -v -m MARCXML --file 2_records_1st_broken.xml
     1 MARC records done in 0.0421221256256104 seconds
  b) limit to 1 record in total
     perl misc/migration_tools/bulkmarcimport.pl -b -v -n 1 -m MARCXML --file 2_records_1st_broken.xml
     1 MARC records done in 0.0420489311218262 seconds
  c) limit to 1 record  offset 1 record
     perl misc/migration_tools/bulkmarcimport.pl -b -v -n 1 -o 1 -m MARCXML --file 2_records_1st_broken.xml
     :2: parser error : Opening and ending tag mismatch: leader2 line 2 and leader
  <leader2>00216nam a22001097a 4500</leader>

3. Apply the patch
4. Repeat steps in 2 and compare the results
  a) 2 MARC records done in 0.0405838489532471 seconds
  b) 1 MARC records done in 0.00948596000671387 seconds  *
  c) 1 MARC records done in 0.0294840335845947 seconds

*though this one was skipped

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-09-14 09:08:31 -06:00
..
admin Bug 40545: (follow-up) Correct GNU link 2025-10-15 16:12:02 -06:00
bin Bug 37538: Improve documentation for the OCLC import daemon script 2026-01-12 10:53:30 -07:00
cronjobs Bug 35948: Add jobs_unfinished_days and jobs_unfinished_type to cleanup_database.pl 2026-08-10 15:52:47 -06:00
devel Bug 38365: Add context to Koha::Devel::Files in add_csp_nonces.pl 2026-03-16 11:57:41 +01:00
interface_customization
…
maintenance Bug 42396: Adjust 'use' statements 2026-09-14 09:08:29 -06:00
migration_tools Bug 41681: (follow-up) Fix record number count when broken records are processed 2026-09-14 09:08:31 -06:00
release_notes Update release notes for 26.05.03.000 release 2026-08-26 10:34:47 +10:00
search_tools Bug 40722: Add a log when resetting mappings during elastic rebuild 2025-10-15 16:12:07 -06:00
translator Bug 41216: (QA follow-up): fix path of xt/author/tt_valid.t in comment 2026-04-10 09:48:11 -06:00
workers Bug 42669: Use exception type check for NoNodes and don't mask real failures 2026-08-10 15:52:40 -06:00
add_date_fields_to_marc_records.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
add_statistics_borrowers_categorycode.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
batchCompareMARCvsFrameworks.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
batchDeleteUnusedSubfields.pl Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
batchImportMARCWithBiblionumbers.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
batchRebuildBiblioTables.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
batchRebuildItemsTables.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
batchRepairMissingBiblionumbers.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
batchdeletebiblios.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
check_sysprefs.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
commit_file.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
export_borrowers.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
export_records.pl Bug 41494: Rename "Koha administration" module name to "Administration" 2026-01-06 07:45:37 -07:00
import_patrons.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
koha-install-log Bug 28519: Put CGI::Session::Serialize::yamlxs in lib directory 2021-06-17 10:07:36 +02:00
link_bibs_to_authorities.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
load_yaml.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
mod_zebraqueue.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
process_ill_updates.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
recreateIssueStatistics.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
sax_parser_print.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
sax_parser_test.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
sip_cli_emulator.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
stage_file.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
z3950_responder.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00