From 5323ab05caef4b7a5c44fb567b412a3917272f33 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Sat, 25 Oct 2008 04:13:50 +0000 Subject: Bug 459064: Set FIELD_TYPE_SINGLE_SELECT on standard global select fields Patch By Max Kanat-Alexander r=bbaetz, a=mkanat --- Bugzilla/Search.pm | 23 +++++------------------ Bugzilla/WebService/Bug.pm | 17 +++-------------- 2 files changed, 8 insertions(+), 32 deletions(-) (limited to 'Bugzilla') diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index ac0099ea5..4b21b216b 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -53,12 +53,6 @@ use Date::Parse; # to, in order. use constant SPECIAL_ORDER => { 'bugs.target_milestone' => [ 'ms_order.sortkey','ms_order.value' ], - 'bugs.bug_status' => [ 'bug_status.sortkey','bug_status.value' ], - 'bugs.rep_platform' => [ 'rep_platform.sortkey','rep_platform.value' ], - 'bugs.priority' => [ 'priority.sortkey','priority.value' ], - 'bugs.op_sys' => [ 'op_sys.sortkey','op_sys.value' ], - 'bugs.resolution' => [ 'resolution.sortkey', 'resolution.value' ], - 'bugs.bug_severity' => [ 'bug_severity.sortkey','bug_severity.value' ] }; # When we add certain fields to the ORDER BY, we need to then add a @@ -66,12 +60,6 @@ use constant SPECIAL_ORDER => { # the join statements that need to be added. use constant SPECIAL_ORDER_JOIN => { 'bugs.target_milestone' => 'LEFT JOIN milestones AS ms_order ON ms_order.value = bugs.target_milestone AND ms_order.product_id = bugs.product_id', - 'bugs.bug_status' => 'LEFT JOIN bug_status ON bug_status.value = bugs.bug_status', - 'bugs.rep_platform' => 'LEFT JOIN rep_platform ON rep_platform.value = bugs.rep_platform', - 'bugs.priority' => 'LEFT JOIN priority ON priority.value = bugs.priority', - 'bugs.op_sys' => 'LEFT JOIN op_sys ON op_sys.value = bugs.op_sys', - 'bugs.resolution' => 'LEFT JOIN resolution ON resolution.value = bugs.resolution', - 'bugs.bug_severity' => 'LEFT JOIN bug_severity ON bug_severity.value = bugs.bug_severity' }; # Create a new Search @@ -117,8 +105,8 @@ sub init { my %special_order = %{SPECIAL_ORDER()}; my %special_order_join = %{SPECIAL_ORDER_JOIN()}; - my @select_fields = Bugzilla->get_fields({ type => FIELD_TYPE_SINGLE_SELECT, - obsolete => 0 }); + my @select_fields = + Bugzilla->get_fields({ type => FIELD_TYPE_SINGLE_SELECT }); my @multi_select_fields = Bugzilla->get_fields({ type => FIELD_TYPE_MULTI_SELECT, obsolete => 0 }); @@ -220,10 +208,9 @@ sub init { } } - my @legal_fields = ("product", "version", "rep_platform", "op_sys", - "bug_status", "resolution", "priority", "bug_severity", - "assigned_to", "reporter", "component", "classification", - "target_milestone", "bug_group"); + my @legal_fields = ("product", "version", "assigned_to", "reporter", + "component", "classification", "target_milestone", + "bug_group"); # Include custom select fields. push(@legal_fields, map { $_->name } @select_fields); diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index 8cfb6acde..b6411968c 100755 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -45,15 +45,6 @@ use constant FIELD_MAP => { platform => 'rep_platform', }; -use constant GLOBAL_SELECT_FIELDS => qw( - bug_severity - bug_status - op_sys - priority - rep_platform - resolution -); - use constant PRODUCT_SPECIFIC_FIELDS => qw(version target_milestone component); ###################################################### @@ -192,13 +183,11 @@ sub legal_values { my ($self, $params) = @_; my $field = FIELD_MAP->{$params->{field}} || $params->{field}; - my @custom_select = Bugzilla->get_fields( - {custom => 1, type => [FIELD_TYPE_SINGLE_SELECT, FIELD_TYPE_MULTI_SELECT]}); - # We only want field names. - @custom_select = map {$_->name} @custom_select; + my @global_selects = Bugzilla->get_fields( + {type => [FIELD_TYPE_SINGLE_SELECT, FIELD_TYPE_MULTI_SELECT]}); my $values; - if (grep($_ eq $field, GLOBAL_SELECT_FIELDS, @custom_select)) { + if (grep($_->name eq $field, @global_selects)) { $values = get_legal_field_values($field); } elsif (grep($_ eq $field, PRODUCT_SPECIFIC_FIELDS)) { -- cgit v1.2.3-24-g4f1b