Bugzilla – Attachment 109263 Details for
Bug 25273
Elasticsearch Authority matching is returning too many results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25273: (follow-up) Don't die on unknown authtype
Bug-25273-follow-up-Dont-die-on-unknown-authtype.patch (text/plain), 2.01 KB, created by
Katrin Fischer
on 2020-08-27 20:49:59 UTC
(
hide
)
Description:
Bug 25273: (follow-up) Don't die on unknown authtype
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-08-27 20:49:59 UTC
Size:
2.01 KB
patch
obsolete
>From 26388893eaec630500c9d2f5c7a9f1cd1c01087c Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 24 Aug 2020 14:24:39 +0000 >Subject: [PATCH] Bug 25273: (follow-up) Don't die on unknown authtype > >We are guessing authtype code and inserting the heading built accorindg to C4::Heading > >If we can't identify the auth type, we can format the heading. There is a record in the koha test >data that is missing the heading field so type cannot be idenfitied > >This prevents us from dying n a record where we cannot identify the type. > >Note: This code will also be triggered for custom authority types, higlighting >that they won't link because of hardcoded mappings in C4::Heading. We must tackle this >on a new bug > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > Koha/SearchEngine/Elasticsearch.pm | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm >index a678ea2610..24ff497e27 100644 >--- a/Koha/SearchEngine/Elasticsearch.pm >+++ b/Koha/SearchEngine/Elasticsearch.pm >@@ -539,9 +539,13 @@ sub marc_records_to_documents { > > if ( $self->index eq 'authorities' ){ > my $authtypecode = GuessAuthTypeCode( $record ); >- my $field = $record->field( $auth_match_headings{ $authtypecode } ); >- my $heading = C4::Heading->new_from_field( $field, undef, 1 ); #new auth heading >- push @{$record_document->{'match-heading'}}, $heading->search_form if $heading; >+ if( $authtypecode ){ >+ my $field = $record->field( $auth_match_headings{ $authtypecode } ); >+ my $heading = C4::Heading->new_from_field( $field, undef, 1 ); #new auth heading >+ push @{$record_document->{'match-heading'}}, $heading->search_form if $heading; >+ } else { >+ warn "Cannot determine authority type for record: " . $record->field('001')->as_string; >+ } > } > > my $mappings = $rules->{leader}; >-- >2.11.0
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 25273
:
103801
|
103854
|
104363
|
105435
|
106759
|
107434
|
108989
|
109261
|
109262
| 109263