Bugzilla – Attachment 42831 Details for
Bug 10407
Allow MARCXML records to be imported with Tools/Stage MARC records for import
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10407 - allow MARCXML records to be imported via Koha's GUI - Catch deadly Record-level errors.
Bug-10407---allow-MARCXML-records-to-be-imported-v.patch (text/plain), 1.89 KB, created by
Olli-Antti Kivilahti
on 2015-09-24 06:01:47 UTC
(
hide
)
Description:
Bug 10407 - allow MARCXML records to be imported via Koha's GUI - Catch deadly Record-level errors.
Filename:
MIME Type:
Creator:
Olli-Antti Kivilahti
Created:
2015-09-24 06:01:47 UTC
Size:
1.89 KB
patch
obsolete
>From 95b5c50d9b5d7237e009eeda466869562652b88e Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Thu, 24 Sep 2015 09:01:19 +0300 >Subject: [PATCH] Bug 10407 - allow MARCXML records to be imported via Koha's > GUI - Catch deadly Record-level errors. > >--- > C4/ImportBatch.pm | 23 +++++++++++++++++------ > 1 file changed, 17 insertions(+), 6 deletions(-) > >diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm >index d013680..4be731a 100644 >--- a/C4/ImportBatch.pm >+++ b/C4/ImportBatch.pm >@@ -1415,7 +1415,7 @@ sub SetImportRecordBiblioMatch { > > =head RecordsFromISO2709File > >- my $records = C4::ImportBatch::RecordsFromISO2709File($input_file, $record_type, $encoding); >+ my ($errors, $records) = C4::ImportBatch::RecordsFromISO2709File($input_file, $record_type, $encoding); > > Reads ISO2709 binary porridge from the given file and creates MARC::Record-objects out of it. > >@@ -1453,7 +1453,7 @@ sub RecordsFromISO2709File { > > =head RecordsFromMARCXMLFile > >- my $records = C4::ImportBatch::RecordsFromMARCXMLFile($input_file, $encoding); >+ my ($errors, $records) = C4::ImportBatch::RecordsFromMARCXMLFile($input_file, $encoding); > > Creates MARC::Record-objects out of the given MARCXML-file. > >@@ -1466,10 +1466,21 @@ sub RecordsFromMARCXMLFile { > my ($filename, $encoding) = @_; > my $batch = MARC::File::XML->in( $filename ); > my @marcRecords; >- while (my $record = $batch->next($encoding)) { #How incredibly hard can be these MARC-libraries be to use? >- push @marcRecords, $record; >- } >- return \@marcRecords; >+ my @errors; >+ my $record; >+ >+ do { >+ eval { >+ $record = $batch->next($encoding); >+ push @marcRecords, $record if $record; >+ }; >+ if ($@) { >+ push @errors, $@; >+ } >+ >+ } while ($@ || $record); >+ >+ return (\@errors, \@marcRecords); > } > > # internal functions >-- >1.9.1
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 10407
:
38101
|
38127
|
38129
|
38133
|
42831
|
53164
|
53165
|
53218
|
53219
|
53220
|
53221
|
53223
|
53306
|
53765
|
53766
|
53767
|
53768
|
53769
|
53937
|
53938
|
53939
|
53940
|
53941