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 <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Frédéric Demians 2022-12-24 09:20:09 +01:00 committed by Tomas Cohen Arazi
parent 0e8f28b942
commit cf04403dd8
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 2 additions and 3 deletions

View File

@ -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,
{