From 3505cd1d0a4330709b26c8be9a2a4b147668c1f0 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 18 Mar 2022 14:25:14 +0000 Subject: [PATCH] Bug 29802: add 'me' to filter_by_visible_in_opac query This patch prefixes all of the fields in OpacHiddenItems with "me." before searching. Unit tests added to cover this case1 To test: 1 - Create a public list 2 - Set OpacHiddenItems to: biblionumber: [1] 3 - Attempt to view list in OPAC 4 - Booom 5 - Aply patch 6 - Reload list 7 - Success Signed-off-by: Fridolin Somers Signed-off-by: Jonathan Druart --- Koha/Items.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Items.pm b/Koha/Items.pm index 551564d8b97..d8bca205194 100644 --- a/Koha/Items.pm +++ b/Koha/Items.pm @@ -127,7 +127,7 @@ sub filter_by_visible_in_opac { my $rules_params; foreach my $field ( keys %$rules ) { - $rules_params->{$field} = + $rules_params->{'me.'.$field} = [ { '-not_in' => $rules->{$field} }, undef ]; } -- 2.25.1