From 3f59550e2b55afe3ba14bf31058bf73517f21824 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Mon, 10 May 2010 10:32:10 -0400 Subject: [PATCH] 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(-) diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index d9f1d20397..8fda3dfbcf 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -302,7 +302,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'); @@ -315,6 +322,9 @@ sub init { $params->param('bug_status', grep(!is_open_state($_), @legal_statuses)); } + else { + $params->param('bug_status', @valid_statuses); + } } if ($params->param('resolution')) { -- 2.47.2