Bugzilla – Attachment 167169 Details for
Bug 36930
Item search gives irrelevant results when using 2+ added filter criteria
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36930: Item search gives irrelevant results when using 2+ added filter criteria
Bug-36930-Item-search-gives-irrelevant-results-whe.patch (text/plain), 1.98 KB, created by
Pedro Amorim
on 2024-05-24 15:08:57 UTC
(
hide
)
Description:
Bug 36930: Item search gives irrelevant results when using 2+ added filter criteria
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-05-24 15:08:57 UTC
Size:
1.98 KB
patch
obsolete
>From 7ba226332e25b40b1b22d09a2293f5ccecc9fbfa Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Wed, 22 May 2024 21:08:35 +0000 >Subject: [PATCH] Bug 36930: Item search gives irrelevant results when using 2+ > added filter criteria > >In the Item search the librarian is allowed, in the first step, to define >additional filters like Title, Author, Publisher, Publication date etc. >(in the third fieldset). This works fine but only for one criterion. >If one adds two or more criteria, the filter does not apply at all. > >Test plan >========= >1. Make an Item search with the Pulblisher filter. Put > %University of California% as the value. > You should get 5 rows (with standard ktd test data set), three > from 1982, and two from 1988. >2. Edit search -> add the second criterion: AND Publication date is 1982. > You would expect three rows but you get 900+ rows. >3. Apply the patch; restart_all. >4. Repeat p. 2. You should get the expected three rows. > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > catalogue/itemsearch.pl | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > >diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl >index 975b96a70b..8cb69c2d85 100755 >--- a/catalogue/itemsearch.pl >+++ b/catalogue/itemsearch.pl >@@ -144,10 +144,11 @@ if ( defined $format ) { > } > } > >- my @c = $cgi->multi_param('c'); >- my @fields = $cgi->multi_param('f'); >- my @q = $cgi->multi_param('q'); >- my @op = $cgi->multi_param('op'); >+ my %param_names = map { $_ => 1 } $cgi->multi_param; >+ my @c = $param_names{'c[]'} ? $cgi->multi_param('c[]') : $cgi->multi_param('c'); >+ my @fields = $param_names{'f[]'} ? $cgi->multi_param('f[]') : $cgi->multi_param('f'); >+ my @q = $param_names{'q[]'} ? $cgi->multi_param('q[]') : $cgi->multi_param('q'); >+ my @op = $param_names{'op[]'} ? $cgi->multi_param('op[]') : $cgi->multi_param('op'); > > my $f; > for (my $i = 0; $i < @fields; $i++) { >-- >2.39.2
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 36930
:
167052
|
167169
|
167340