Bugzilla – Attachment 174389 Details for
Bug 38416
Failover to MARCXML if cannot roundtrip USMARC when indexing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38416: Tidy
Bug-38416-Tidy.patch (text/plain), 3.57 KB, created by
David Cook
on 2024-11-11 22:19:24 UTC
(
hide
)
Description:
Bug 38416: Tidy
Filename:
MIME Type:
Creator:
David Cook
Created:
2024-11-11 22:19:24 UTC
Size:
3.57 KB
patch
obsolete
>From dec4dc6b02b73e5bed5bca33178c3df59d4bee06 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Mon, 11 Nov 2024 22:17:58 +0000 >Subject: [PATCH] Bug 38416: Tidy > >--- > Koha/SearchEngine/Elasticsearch.pm | 5 +++-- > .../Koha/SearchEngine/Elasticsearch.t | 21 +++++++++++-------- > 2 files changed, 15 insertions(+), 11 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm >index 13541d0849..dba0fbd934 100644 >--- a/Koha/SearchEngine/Elasticsearch.pm >+++ b/Koha/SearchEngine/Elasticsearch.pm >@@ -819,14 +819,15 @@ sub marc_records_to_documents { > > #NOTE: Try to round-trip the record to prove it will work for retrieval after searching > my $decoded_usmarc_record = MARC::Record->new_from_usmarc($usmarc_record); >- if ($decoded_usmarc_record->warnings()){ >+ if ( $decoded_usmarc_record->warnings() ) { >+ > #NOTE: We override the warnings since they're many and misleading > @warnings = ( > "Warnings encountered while roundtripping a MARC record to/from USMARC. Failing over to MARCXML.", > ); > } > >- my $marc_data = encode_base64(encode('UTF-8', $usmarc_record)); >+ my $marc_data = encode_base64( encode( 'UTF-8', $usmarc_record ) ); > $record_document->{'marc_data'} = $marc_data; > } > if (@warnings) { >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >index 79f4281f96..24159799f8 100755 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >@@ -756,20 +756,23 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > $marc_record_with_large_field->leader(' cam 22 a 4500'); > > $marc_record_with_large_field->append_fields( >- MARC::Field->new('100', '', '', a => 'Author 1'), >- MARC::Field->new('245', '', '', a => 'Title:', b => 'record with large field'), >- MARC::Field->new('500', '', '', a => 'X' x 15000), >- MARC::Field->new('999', '', '', c => '1234567'), >+ MARC::Field->new( '100', '', '', a => 'Author 1' ), >+ MARC::Field->new( '245', '', '', a => 'Title:', b => 'record with large field' ), >+ MARC::Field->new( '500', '', '', a => 'X' x 15000 ), >+ MARC::Field->new( '999', '', '', c => '1234567' ), > ); > >- $docs = $see->marc_records_to_documents([$marc_record_with_large_field]); >+ $docs = $see->marc_records_to_documents( [$marc_record_with_large_field] ); > >- is($docs->[0]->{marc_format}, 'MARCXML', 'For record with large field marc_format should be set correctly'); >+ is( $docs->[0]->{marc_format}, 'MARCXML', 'For record with large field marc_format should be set correctly' ); > >- $decoded_marc_record = $see->decode_record_from_result($docs->[0]); >+ $decoded_marc_record = $see->decode_record_from_result( $docs->[0] ); > >- ok($decoded_marc_record->isa('MARC::Record'), "MARCXML record successfully decoded from result"); >- is($decoded_marc_record->as_xml_record(), $marc_record_with_large_field->as_xml_record(), "Decoded MARCXML record has same data as original record"); >+ ok( $decoded_marc_record->isa('MARC::Record'), "MARCXML record successfully decoded from result" ); >+ is( >+ $decoded_marc_record->as_xml_record(), $marc_record_with_large_field->as_xml_record(), >+ "Decoded MARCXML record has same data as original 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 38416
:
174318
|
174319
|
174389
|
174459
|
174460
|
174461
|
174542
|
174543
|
174544