Bug 16325: Do not return all suggestions if search for STATUS=''

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 <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2016-05-03 16:13:44 +01:00 committed by Brendan Gallagher
parent cb912decef
commit 44e0cb2895

View file

@ -160,7 +160,10 @@ sub SearchSuggestion {
if ( exists $suggestion->{$field} if ( exists $suggestion->{$field}
and defined $suggestion->{$field} and defined $suggestion->{$field}
and $suggestion->{$field} ne '__ANY__' and $suggestion->{$field} ne '__ANY__'
and $suggestion->{$field} ne q|| and (
$suggestion->{$field} ne q||
or $field eq 'STATUS'
)
) { ) {
if ( $suggestion->{$field} eq '__NONE__' ) { if ( $suggestion->{$field} eq '__NONE__' ) {
push @query, qq{ AND (suggestions.$field = '' OR suggestions.$field IS NULL) }; push @query, qq{ AND (suggestions.$field = '' OR suggestions.$field IS NULL) };