From 44e0cb2895f5e9fbf541603f5497f67f58fd5baf Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 3 May 2016 16:13:44 +0100 Subject: [PATCH] Bug 16325: Do not return all suggestions if search for STATUS='' MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is a quick and dirty way to fix a bad bug in a messy area. The "unknown status" tab in the suggestions table display all the suggestions. It should only display suggestions with a STATUS='' Test plan: - Create some suggestions - Go to Home > Acquisitions > Suggestions management - Edit some suggestions and give them different status, e.g. accepted, rejected, pending. - Verify that they appear in the tabs as appropriate - Edit one suggestion, set "Mark selected as" to --Choose a status-- => Without this patch: New tab "Status unknown" containing all suggestions => With this patch: tab contains only suggestions with "Unknown status" Works as expected. Signed-off-by: Marc Véron Signed-off-by: Katrin Fischer Signed-off-by: Brendan Gallagher --- C4/Suggestions.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index 63e10ed2fa..8e76cea4d7 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -160,7 +160,10 @@ sub SearchSuggestion { if ( exists $suggestion->{$field} and defined $suggestion->{$field} and $suggestion->{$field} ne '__ANY__' - and $suggestion->{$field} ne q|| + and ( + $suggestion->{$field} ne q|| + or $field eq 'STATUS' + ) ) { if ( $suggestion->{$field} eq '__NONE__' ) { push @query, qq{ AND (suggestions.$field = '' OR suggestions.$field IS NULL) }; -- 2.39.5