Bugzilla – Attachment 97413 Details for
Bug 24236
Using quotes in a cataloging search, resulting in multiple pages, will not allow you to advance page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24236: Fix pagination to use query_cgi
Bug-24236-Fix-pagination-to-use-querycgi.patch (text/plain), 2.79 KB, created by
ByWater Sandboxes
on 2020-01-15 19:23:44 UTC
(
hide
)
Description:
Bug 24236: Fix pagination to use query_cgi
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2020-01-15 19:23:44 UTC
Size:
2.79 KB
patch
obsolete
>From 7cbd2d71757e1bdfa3e990ccd459a0565fac3ded Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 13 Dec 2019 16:08:16 +0000 >Subject: [PATCH] Bug 24236: Fix pagination to use query_cgi > >This is still wrong, we should use page-numbers.inc, but that is a larger refactoring >This patch fixes non-QueryParser searches by simple getting an using the escaped query (query_cgi) > >For QueryParser, we do what the QP code does, just uri escape the query - the way that SimpleSearch does the query parsing instead of the usual buildQuery suggest to me that we should probably switch all of this to use the general Zebra search. > >The issues with reservoir should be their own bug > >To test: >1 - Search for cat in cataloging search >2 - Get results and see you can paginate >3 - Search for "cat" >4 - Get results but subsequent pages empty >5 - Apply patch >6 - Repeat search for "cat" >7 - You can paginate >8 - Enable UseQueryParser syspref (don't worry about installing) >9 - Confirm can still search with quotes and paginate > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> > >Signed-off-by: George Williams <george@nekls.org> >--- > cataloguing/addbooks.pl | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > >diff --git a/cataloguing/addbooks.pl b/cataloguing/addbooks.pl >index 2082913862..b9ed6ff874 100755 >--- a/cataloguing/addbooks.pl >+++ b/cataloguing/addbooks.pl >@@ -27,6 +27,7 @@ > use Modern::Perl; > > use CGI qw ( -utf8 ); >+use URI::Escape; > use C4::Auth; > use C4::Biblio; > use C4::Breeding; >@@ -70,14 +71,16 @@ if ($query) { > my $QParser; > $QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser')); > my $builtquery; >+ my $query_cgi; > my $builder = Koha::SearchEngine::QueryBuilder->new( > { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); > my $searcher = Koha::SearchEngine::Search->new( > { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); > if ($QParser) { > $builtquery = $query; >+ $query_cgi = "q=".uri_escape_utf8($query); > } else { >- ( undef, $builtquery, undef, undef, undef, undef, undef, undef, undef, undef ) = >+ ( undef, $builtquery, undef, $query_cgi, undef, undef, undef, undef, undef, undef ) = > $builder->build_query_compat( undef, \@operands, undef, undef, undef, 0, $lang ); > } > # find results >@@ -101,7 +104,7 @@ if ($query) { > total => $total_hits, > query => $query, > resultsloop => \@newresults, >- pagination_bar => pagination_bar( "/cgi-bin/koha/cataloguing/addbooks.pl?q=$query&", getnbpages( $total_hits, $results_per_page ), $page, 'page' ), >+ pagination_bar => pagination_bar( "/cgi-bin/koha/cataloguing/addbooks.pl?$query_cgi&", getnbpages( $total_hits, $results_per_page ), $page, 'page' ), > ); > } > >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24236
:
96264
|
97407
|
97413
|
97657