From 754271223be8ad91f0c699fac3b068726c965ed7 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 Signed-off-by: Kyle M Hall --- opac/opac-detail.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 247705c0cc..040af162e5 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -62,6 +62,7 @@ use Koha::Plugins; use Koha::Ratings; use Koha::Reviews; use Koha::SearchEngine::Search; +use Koha::SearchEngine::QueryBuilder; use Try::Tiny; @@ -183,8 +184,14 @@ if ( $xslfile ) { 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