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>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Janusz Kaczmarek 2024-05-22 21:08:35 +00:00 committed by Martin Renvoize
parent cd95ea29c0
commit bdc7ac2c93
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -150,10 +150,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++) {