Bug 42803: Fix case where filter is not supplied

This change fixes the case where "Any library" and "Any item type"
weren't validating.

Test plan:
0) Apply the patch
1) Set strict_sql_modes to 0 in koha-conf.xml and restart plack
2) Go to Reports > Items with no checkouts:
<staff_url>/cgi-bin/koha/reports/catalogue_out.pl
3) Leave Library set to "Any library"
4) Pick a specific item type that you know has items (e.g. "BK")
5) Note that you get results

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
David Cook 2026-06-19 05:54:37 +00:00 committed by Pedro Amorim
parent 25496bdc4f
commit d2a76b80b0
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ my @filters_input = $input->multi_param("Filter");
#NOTE: Validate Filter parameter
if (@filters_input) {
foreach my $filter (@filters_input) {
if ( Koha::Libraries->find($filter) || Koha::ItemTypes->find($filter) ) {
if ( Koha::Libraries->find($filter) || Koha::ItemTypes->find($filter) || !$filter ) {
push( @filters, $filter );
}
}