Bugzilla – Attachment 188705 Details for
Bug 41147
Counts in bulkmarcimport.pl are incorrect
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41147: Don't double count records
Bug-41147-Dont-double-count-records.patch (text/plain), 1.40 KB, created by
Nick Clemens (kidclamp)
on 2025-10-30 18:24:09 UTC
(
hide
)
Description:
Bug 41147: Don't double count records
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-10-30 18:24:09 UTC
Size:
1.40 KB
patch
obsolete
>From ed24da7e0f7e42fbd31183087e7b76179bc77984 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 30 Oct 2025 18:17:47 +0000 >Subject: [PATCH] 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 >--- > misc/migration_tools/bulkmarcimport.pl | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl >index cd5fa255a6e..88c42e61e3f 100755 >--- a/misc/migration_tools/bulkmarcimport.pl >+++ b/misc/migration_tools/bulkmarcimport.pl >@@ -329,7 +329,9 @@ $schema->txn_begin; > RECORD: while () { > > my $record; >- $record_number++; >+ $record_number++ >+ ; # We increment here, if a record is skipped because we can't load form the batch or can't be converted >+ # it still counts against the limit if a number to process is passed > > # get record > eval { $record = $batch->next() }; >@@ -345,7 +347,6 @@ RECORD: while () { > next; > } > if ($record) { >- $record_number++; > > if ($skip_bad_records) { > my $xml = $record->as_xml_record(); >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41147
: 188705