From e1e48d1bd636d5882a8d4a8fe73efaf880981f12 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 3 May 2016 16:13:44 +0100 Subject: [PATCH] [PASSED QA] Bug 16325: Do not return all suggestions if search for STATUS='' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 --- C4/Suggestions.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index 63e10ed..8e76cea 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) }; -- 1.9.1