]> git.koha-community.org Git - koha.git/commit
Bug 37478: Add strict mode to bulkmarcimport
authorNick Clemens <nick@bywatersolutions.com>
Thu, 25 Jul 2024 16:37:17 +0000 (16:37 +0000)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Fri, 8 Nov 2024 10:23:45 +0000 (11:23 +0100)
commit0306281e417ffe8f3f7e3ff033f58a0872ce980d
treef4e717a63c86f735c6964e9c5098b83d0aaddfa6
parent431b2c4a5dc5b3c213c5fb6c92ef9f7fad95a422
Bug 37478: Add strict mode to bulkmarcimport

This patch adds a conversion from MARC -> XML -> MARC to catch any parsing errors.
If errors are found, we then lint the record to catch any problems, output the
warnings, and skip the record.

To test:
1 - Download the sample records from this bug report
2 - perl misc/migration_tools/bulkmarcimport.pl -b --file=520_nosubfield.mrc -v
    fails!
3 - perl misc/migration_tools/bulkmarcimport.pl -b --file=003_subfielda.mrc -v
    fails!
4 - Apply patch
5 - Repeat 2 & 3 - no change
6 - Add -st switch to the commands:
    perl misc/migration_tools/bulkmarcimport.pl -b --file=520_nosubfield.mrc -v -st
    perl misc/migration_tools/bulkmarcimport.pl -b --file=003_subfielda.mrc -v -st
7 - The records are now skipped, and the script completes
8 - Confirm the warnings generated are useful
9 - Sign off!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
misc/migration_tools/bulkmarcimport.pl