Bugzilla – Attachment 54202 Details for
Bug 17088
Bad MARC XML can halt export_records.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17088 - Bad MARC XML can halt export_records.pl
Bug-17088---Bad-MARC-XML-can-halt-exportrecordspl.patch (text/plain), 1.66 KB, created by
Kyle M Hall (khall)
on 2016-08-09 13:12:32 UTC
(
hide
)
Description:
Bug 17088 - Bad MARC XML can halt export_records.pl
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-08-09 13:12:32 UTC
Size:
1.66 KB
patch
obsolete
>From e4d36d54738633ebbc7bc0375e2716a686b2e344 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 9 Aug 2016 13:08:17 +0000 >Subject: [PATCH] Bug 17088 - Bad MARC XML can halt export_records.pl > >If export_records.pl encounters a record that fails to load correctly as >a MARC::Record the export process will fail and only the records >encountered up to that point will be exported. > >Test Plan: >1) Pick a record in your database, and replace the biblioitems.marcxml field with some random characters >2) Export your records using the command: > misc/export_records.pl --format xml --record-type bibs --filename /tmp/biblios.xml >3) Note you get an error and the script ends prematurely >4) Apply this patch >5) Repeat step 2 >6) Note the full record set is exported ( except for your bad record ) >7) Note an error is still generated for your bad record ( useful for > tracking down bad records ). >--- > Koha/Exporter/Record.pm | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/Koha/Exporter/Record.pm b/Koha/Exporter/Record.pm >index ef2a37d..6fad1f3 100644 >--- a/Koha/Exporter/Record.pm >+++ b/Koha/Exporter/Record.pm >@@ -27,6 +27,8 @@ sub _get_record_for_export { > return; > } > >+ return unless $record; >+ > if ($dont_export_fields) { > for my $f ( split / /, $dont_export_fields ) { > if ( $f =~ m/^(\d{3})(.)?$/ ) { >@@ -128,6 +130,7 @@ sub export { > print "\n"; > for my $record_id (@$record_ids) { > my $record = _get_record_for_export( { %$params, record_id => $record_id } ); >+ next unless $record; > print MARC::File::XML::record($record); > print "\n"; > } >-- >2.1.4
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 17088
:
54202
|
55609
|
55610
|
55611
|
56032
|
56033
|
56034
|
56035