From 3e6c56965097f35520bafb06586606f8268e71a9 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 16 Mar 2018 09:03:46 +0000 Subject: [PATCH] Bug 19581: (follow-up) Fix handling of new and old arrays for auth compat Stolen from bug 20244 --- Koha/SearchEngine/Elasticsearch/Search.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm index 4d584f7..459e485 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/Koha/SearchEngine/Elasticsearch/Search.pm @@ -200,9 +200,9 @@ sub search_auth_compat { # I wonder if these should be real values defined in the mapping # rather than hard-coded conversions. - # Our results often come through as nested arrays, to fix this - # requires changes in catmandu. - my $authid = $record->{ 'Local-number' }[0][0]; + # Handle legacy nested arrays indexed with splitting enabled. + my $authid = $record->{ 'Local-number' }[0]; + $authid = @$authid[0] if (ref $authid eq 'ARRAY'); $result{authid} = $authid; # TODO put all this info into the record at index time so we -- 2.1.4