Bug 17048: Fix pagination offset for authority searches
At the intranet, the pagination has been broken by bug 12478 (Elastic Search). There was a confusion between the offset and the page number. At the OPAC, it is broken since bug 2735 which has mimicked the intranet script. Test plan: Search for a term which will return more than 1 page of results. Click on the second page => Without this patch, the first result of the second page is the second result of the first page => With this patch applied, the offset will be corrected Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
6f5e2f8a86
commit
bff08b9962
2 changed files with 4 additions and 3 deletions
|
@ -87,9 +87,9 @@ if ( $op eq "do_search" ) {
|
||||||
[$marclist], [$and_or], [$excluding], [$operator],
|
[$marclist], [$and_or], [$excluding], [$operator],
|
||||||
[$value], $authtypecode, $orderby
|
[$value], $authtypecode, $orderby
|
||||||
);
|
);
|
||||||
$startfrom = $startfrom // 0;
|
my $offset = ( $startfrom - 1 ) * $resultsperpage + 1;
|
||||||
my ( $results, $total ) =
|
my ( $results, $total ) =
|
||||||
$searcher->search_auth_compat( $search_query, $startfrom,
|
$searcher->search_auth_compat( $search_query, $offset,
|
||||||
$resultsperpage );
|
$resultsperpage );
|
||||||
#my ( $results, $total ) = SearchAuthorities(
|
#my ( $results, $total ) = SearchAuthorities(
|
||||||
# [$marclist], [$and_or],
|
# [$marclist], [$and_or],
|
||||||
|
|
|
@ -64,8 +64,9 @@ if ( $op eq "do_search" ) {
|
||||||
{ index => $Koha::SearchEngine::AUTHORITIES_INDEX } );
|
{ index => $Koha::SearchEngine::AUTHORITIES_INDEX } );
|
||||||
my $search_query = $builder->build_authorities_query_compat( \@marclist, \@and_or,
|
my $search_query = $builder->build_authorities_query_compat( \@marclist, \@and_or,
|
||||||
\@excluding, \@operator, \@value, $authtypecode, $orderby );
|
\@excluding, \@operator, \@value, $authtypecode, $orderby );
|
||||||
|
my $offset = ( $startfrom - 1 ) * $resultsperpage + 1;
|
||||||
my ( $results, $total ) =
|
my ( $results, $total ) =
|
||||||
$searcher->search_auth_compat( $search_query, $startfrom, $resultsperpage );
|
$searcher->search_auth_compat( $search_query, $offset, $resultsperpage );
|
||||||
( $template, $loggedinuser, $cookie ) = get_template_and_user(
|
( $template, $loggedinuser, $cookie ) = get_template_and_user(
|
||||||
{
|
{
|
||||||
template_name => "opac-authoritiessearchresultlist.tt",
|
template_name => "opac-authoritiessearchresultlist.tt",
|
||||||
|
|
Loading…
Reference in a new issue