Bugzilla – Attachment 6178 Details for
Bug 6799
rebuild_zebra.pl -x produces invalid XML records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Signed off patch
0001-Bug-6799-rebuild_zebra.pl-x-produces-invalid-XML-rec.patch (text/plain), 2.06 KB, created by
Julian Maurice
on 2011-11-04 05:48:54 UTC
(
hide
)
Description:
Signed off patch
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2011-11-04 05:48:54 UTC
Size:
2.06 KB
patch
obsolete
>From 17237435549d25880e746d1600efec163882226e Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= <f.demians@tamil.fr> >Date: Sat, 27 Aug 2011 13:32:08 +0200 >Subject: [PATCH] Bug 6799 rebuild_zebra.pl -x produces invalid XML records > >This patch allow to handle properly items containing extended characters and >send valid XML records to zebraidx > >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > misc/migration_tools/rebuild_zebra.pl | 12 +++++------- > 1 files changed, 5 insertions(+), 7 deletions(-) > >diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl >index 6fa6501..fa87f22 100755 >--- a/misc/migration_tools/rebuild_zebra.pl >+++ b/misc/migration_tools/rebuild_zebra.pl >@@ -323,19 +323,17 @@ sub export_marc_records_from_sth { > my @items = GetItemsInfo($record_number); > if (@items){ > my $record = MARC::Record->new; >+ $record->encoding('UTF-8'); > my @itemsrecord; > foreach my $item (@items){ > my $record = Item2Marc($item, $record_number); > push @itemsrecord, $record->field($itemtag); > } > $record->insert_fields_ordered(@itemsrecord); >- my $itemsxml=$record->as_xml_record(); >- my $searchstring = '<record>\n'; >- my $index = index($itemsxml, '<record>\n', 0); >- $itemsxml = substr($itemsxml, $index + length($searchstring)); >- $searchstring = '</record>'; >- $marcxml = substr($marcxml, 0, index($marcxml, $searchstring)); >- $marcxml .= $itemsxml; >+ my $itemsxml = $record->as_xml_record(); >+ $marcxml = >+ substr($marcxml, 0, length($marcxml)-10) . >+ substr($itemsxml, index($itemsxml, "</leader>\n", 0) + 10); > } > } > if ( $marcxml ) { >-- >1.7.7.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 6799
:
5173
| 6178