From 910d4cd251416fdcfe8cdb3d453208b16ae53000 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Fri, 7 May 2010 12:39:52 -0400 Subject: Bug 478771: Bugzilla::Search should drop invalid bug statuses from the search criteria r/a=mkanat --- Bugzilla/Search.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Bugzilla') diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 9bdc35182..271e23298 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -312,7 +312,14 @@ sub init { my @legal_statuses = map {$_->name} @{Bugzilla::Field->new({name => 'bug_status'})->legal_values}; - if (scalar(@bug_statuses) == scalar(@legal_statuses) + # Filter out any statuses that have been removed completely that are still + # being used by the client + my @valid_statuses; + foreach my $status (@bug_statuses) { + push(@valid_statuses, $status) if grep($_ eq $status, @legal_statuses); + } + + if (scalar(@valid_statuses) == scalar(@legal_statuses) || $bug_statuses[0] eq "__all__") { $params->delete('bug_status'); @@ -325,6 +332,9 @@ sub init { $params->param('bug_status', grep(!is_open_state($_), @legal_statuses)); } + else { + $params->param('bug_status', @valid_statuses); + } } if ($params->param('resolution')) { -- cgit v1.2.3-24-g4f1b