Browse Source

Bug 28484: ES clean title in biblio detail

Test plan:
 - Create a biblio with title like "osteuropa:" or "osteuropa!"
 - Go the this biblio detail pages (cgi-bin/koha/catalogue/detail.pl)
   => Error
 - Apply bug 28316 and this one
 - test again

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.11.x
Alex Arnaud 3 years ago
committed by Jonathan Druart
parent
commit
e994012c9d
  1. 13
      Koha/SearchEngine/Zebra/QueryBuilder.pm
  2. 6
      catalogue/detail.pl

13
Koha/SearchEngine/Zebra/QueryBuilder.pm

@ -73,4 +73,17 @@ sub build_authorities_query_compat {
build_authorities_query(@_);
}
=head2 clean_search_term
my $term = $self->clean_search_term($term);
=cut
sub clean_search_term {
my ( $self, $term ) = @_;
return $term;
}
1;

6
catalogue/detail.pl

@ -55,6 +55,7 @@ use Koha::Patrons;
use Koha::Virtualshelves;
use Koha::Plugins;
use Koha::SearchEngine::Search;
use Koha::SearchEngine::QueryBuilder;
my $query = CGI->new();
@ -128,8 +129,13 @@ my $marcflavour = C4::Context->preference("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)'

Loading…
Cancel
Save