Bugzilla – Attachment 111064 Details for
Bug 7607
Advanced search: Index and search term don't match when leaving fields empty
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7607: Fix adv search when leaving fields empty
Bug-7607-Fix-adv-search-when-leaving-fields-empty.patch (text/plain), 2.80 KB, created by
Marcel de Rooy
on 2020-10-02 08:04:46 UTC
(
hide
)
Description:
Bug 7607: Fix adv search when leaving fields empty
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-10-02 08:04:46 UTC
Size:
2.80 KB
patch
obsolete
>From e12641c8452590f94940143b996d4fdc17ae8037 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 7 Aug 2020 14:50:15 +0200 >Subject: [PATCH] Bug 7607: Fix adv search when leaving fields empty >Content-Type: text/plain; charset=utf-8 > >We have a rewrite rule in our apache config that remove empty >parameters: > RewriteCond %{QUERY_STRING} (.*?)(?:[A-Za-z0-9_-]+)=&(.*) > >That causes the advanced search to search on the wrong index if an input >field is left empty. > >Test plan (staff and OPAC): >- leave the first pulldown on keyword and the search term empty >- select author or title from the second pull down and enter a search term > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../intranet-tmpl/prog/en/modules/catalogue/advsearch.tt | 12 +++++++++++- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt | 8 ++++++++ > 2 files changed, 19 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >index 673aa2d7c9..b993cd0859 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >@@ -34,7 +34,7 @@ > <div class="row"> > <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2"> > >-<form action="search.pl" method="get"> >+<form id="adv-search-form" action="search.pl" method="get"> > <div id="advanced-search"> > <input type="hidden" name="advsearch" value="1"/> > <h1>Advanced search</h1> >@@ -344,6 +344,16 @@ > browser.show_back_link(); > [% END %] > >+ $("#adv-search-form").on("submit", function(){ >+ var idx = $("select[name='idx']"); >+ var i = 0; >+ $("input[name='q']").each(function(){ >+ if( !$(this).val().length ) { >+ $(idx[i]).val(""); >+ } >+ i++; >+ }); >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >index 1965b4d361..7efd9b193c 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >@@ -502,6 +502,14 @@ $(document).ready(function() { > jQuery.cookie("search_path_code", 'ads',{ path: '/'}); > jQuery.removeCookie("num_paragraph", { path: '/'}); > [% END %] >+ >+ var i = 0; >+ $("input[name='q']").each(function(){ >+ if( !$(this).val().length ) { >+ $("#search-field_"+i).val(""); >+ } >+ i++; >+ }); > }); > > }); >-- >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 7607
:
107963
|
110845
|
110849
|
111064
|
111065
|
112912
|
112963
|
112964
|
113133
|
113134
|
113682
|
113683
|
113691
|
113692
|
113781
|
113872
|
113873
|
113874