From 0960cec0012835f2134bd607712a12973a721517 Mon Sep 17 00:00:00 2001 From: Shi Yao Wang Date: Mon, 22 Aug 2022 15:08:19 -0400 Subject: [PATCH] Bug 27113: (follow-up) replace removed GetMarcBiblio --- opac/svc/elasticsearch/opac-elasticsearch.pl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/opac/svc/elasticsearch/opac-elasticsearch.pl b/opac/svc/elasticsearch/opac-elasticsearch.pl index 1ab233d284..8e38d2b72c 100755 --- a/opac/svc/elasticsearch/opac-elasticsearch.pl +++ b/opac/svc/elasticsearch/opac-elasticsearch.pl @@ -10,7 +10,8 @@ use Koha::SearchEngine::Elasticsearch::Browse; use Koha::Items; use C4::Context; -use C4::Biblio qw ( GetMarcBiblio ); +use C4::Biblio; +use Koha::Biblios; my $browser = Koha::SearchEngine::Elasticsearch::Browse->new( { index => 'biblios' } ); my $cgi = CGI->new; @@ -60,10 +61,8 @@ sub filterAutocomplete { # marc field 942$n set to true and OpacSuppression preference on if (C4::Context->preference('OpacSuppression')) { for ( my $i = 0; $i < scalar @{$hitlist}; $i++ ) { - my $record = GetMarcBiblio({ - biblionumber => $hitlist->[$i]->{ "_id" }, - opac => 1 - }); + my $biblio = Koha::Biblios->find($hitlist->[$i]->{ "_id" }); + my $record = $biblio->metadata->record; my $opacsuppressionfield = '942'; my $opacsuppressionfieldvalue = $record->field($opacsuppressionfield); if ( $opacsuppressionfieldvalue && -- 2.34.1