From 8d788a65ce137d4293efa58aedd0109a0cab2e13 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 28 Sep 2021 20:24:39 +0000 Subject: [PATCH] Bug 28484: (QA follow-up) Add fix on OPAC Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- opac/opac-detail.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index a9eb913f00..0860aa487a 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -83,6 +83,7 @@ use Koha::Plugins; use Koha::Ratings; use Koha::Reviews; use Koha::SearchEngine::Search; +use Koha::SearchEngine::QueryBuilder; my $query = CGI->new(); @@ -197,8 +198,14 @@ my $ean = GetNormalizedEAN( $record, $marcflavour ); my $searcher = Koha::SearchEngine::Search->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); + my $builder = Koha::SearchEngine::QueryBuilder->new( + { index => $Koha::SearchEngine::BIBLIOS_INDEX } + ); + my $cleaned_title = $biblio->title; $cleaned_title =~ tr|/||; + $cleaned_title = $builder->clean_search_term($cleaned_title); + my $query = ( C4::Context->preference('UseControlNumber') and $record->field('001') ) ? 'rcn:'. $record->field('001')->data . ' AND (bib-level:a OR bib-level:b)' -- 2.39.5