From bdb30b3b8e161558a460c7d7661b761ef2e7b504 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 Signed-off-by: Fridolin Somers --- Koha/Items.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Items.pm b/Koha/Items.pm index 551564d8b9..d8bca20519 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.39.5