Bugzilla – Attachment 73479 Details for
Bug 20385
ElasticSearch authority search raises Software error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20385 - Don't try to get info for bad authtypecodes
Bug-20385---Dont-try-to-get-info-for-bad-authtypec.patch (text/plain), 2.20 KB, created by
Alex Arnaud
on 2018-03-30 13:25:48 UTC
(
hide
)
Description:
Bug 20385 - Don't try to get info for bad authtypecodes
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2018-03-30 13:25:48 UTC
Size:
2.20 KB
patch
obsolete
>From f338e56dc2bb835d95d1c9dba4f2fe56f21d48a8 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 13 Mar 2018 14:57:47 +0000 >Subject: [PATCH] Bug 20385 - Don't try to get info for bad authtypecodes > >TO test: >0 - Have a koha with ES enabled and some auth records >1 - backup your db >2 - sudo koha-mysql <<instance>> >3 - UPDATE auth_types SET authtypecode="PERSO_NAMB" WHERE >authtypecode="PERSO_NAME" (or adjust as necessary) >4 - Search for some authorities where a PERSO_NAME record will be >returned >5 - KA_BOOM! >6 - Apply patch >7 - Results are returned, they do not display a code, viewing record you >won't see code > >Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> >Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> >--- > Koha/SearchEngine/Elasticsearch/Search.pm | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm >index 4d584f7..2ddd165 100644 >--- a/Koha/SearchEngine/Elasticsearch/Search.pm >+++ b/Koha/SearchEngine/Elasticsearch/Search.pm >@@ -217,7 +217,7 @@ sub search_auth_compat { > # with the record. It's not documented why this is the case, so > # it's not reproduced here yet. > my $authtype = $rs->single; >- my $auth_tag_to_report = $authtype->auth_tag_to_report; >+ my $auth_tag_to_report = $authtype ? $authtype->auth_tag_to_report : $authtypecode; > my $marc = $self->json2marc($marc_json); > my $mainentry = $marc->field($auth_tag_to_report); > my $reported_tag; >@@ -227,11 +227,7 @@ sub search_auth_compat { > } > } > # Turn the resultset into a hash >- my %authtype_cols; >- foreach my $col ($authtype->result_source->columns) { >- $authtype_cols{$col} = $authtype->get_column($col); >- } >- $result{authtype} = $authtype->authtypetext; >+ $result{authtype} = $authtype ? $authtype->authtypetext : $authtypecode; > $result{reported_tag} = $reported_tag; > > # Reimplementing BuildSummary is out of scope because it'll be hard >-- >2.7.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 20385
:
72802
|
72810
|
73212
| 73479 |
73480