Bug 25229: Return authid of record rather than 001

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Nick Clemens 2020-04-21 13:47:59 +00:00 committed by Martin Renvoize
parent 1cd3482664
commit 7fa460486d
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 4 additions and 6 deletions

View File

@ -207,12 +207,10 @@ sub search_auth_compat {
my $record = $es_record->{'_source'};
my %result;
# I wonder if these should be real values defined in the mapping
# rather than hard-coded conversions.
#my $record = $_[0];
# Handle legacy nested arrays indexed with splitting enabled.
my $authid = $record->{ 'local-number' }[0];
$authid = @$authid[0] if (ref $authid eq 'ARRAY');
# We are using the authid to create links, we should honor the authid as stored in the db, not
# the 001 which, in some circumstances, can contain other data
my $authid = $es_record->{_id};
$result{authid} = $authid;