From 80074333e0085350bc664c6e164027d382b4c901 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Sat, 24 Dec 2022 09:20:09 +0100 Subject: [PATCH] Bug 32531: Restore behaviour of 'include archived' filter In Suggestions management, there is a sidebar menu to organize and filter suggestions. In the "Suggestion information" filter section, there is a checkbox "Include archived". When this box us unchecked, the archived suggestions are not displayed. When this box is checked, all suggestions are displayed, archived, and not archived. This is not the case anymore, only archived suggestions are displayed, supposedly since patch for bug 23991. TO TEST: 1. On a Koha installation remove all suggestions (in the table). 2. Create two suggestions. Archive one of them. 3. Check/Uncheck filter 'Include Archived'. Confirm that when the box is checked, you don't see anymore the unarchived suggestion. 4. Apply the patch. 5. Repeat 3, and confirm that the filter operates properly. Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi (cherry picked from commit cf04403dd88f747c92bc776cc4e130bc6e24e91c) Signed-off-by: Jacob O'Mara --- suggestion/suggestion.pl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index 0e5ec8f80a..f85b4366ea 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -411,9 +411,8 @@ if ($op=~/else/) { || $search_params->{$f} eq ''; } - my @suggestions = - Koha::Suggestions->search_limited( - { %$search_params, archived => $filter_archived } )->as_list; + $search_params->{archived} = 0 if !$filter_archived; + my @suggestions = Koha::Suggestions->search_limited($search_params)->as_list; push @allsuggestions, { -- 2.20.1