From 884a11d011790b5082d29d732c38171793bc83b5 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 Signed-off-by: Kyle M Hall --- Koha/Items.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Items.pm b/Koha/Items.pm index 0730935a0b..9a5db96af4 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