From 49c289eb1f747da7530fa93e43760afcfcf016f0 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 Signed-off-by: Julian Maurice Signed-off-by: Jonathan Druart --- 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 b8f03cbc70..063dca306b 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.39.5