Commit 910d4cd2 authored by David Lawrence's avatar David Lawrence

Bug 478771: Bugzilla::Search should drop invalid bug statuses from the search criteria

r/a=mkanat
parent 4ec67697
......@@ -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')) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment