From 30c7fa92ac2d0c76443fcc47907487a9ff0186b2 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Tue, 12 Feb 2008 07:32:51 +0000 Subject: Bug 384009: Global fields (priority, severity, OS, and platform) are required when using WebService instead of using the defaults - Patch by Frédéric Buclin r/a=mkanat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- email_in.pl | 56 -------------------------------------------------------- 1 file changed, 56 deletions(-) (limited to 'email_in.pl') diff --git a/email_in.pl b/email_in.pl index ca7a29735..248b86bb8 100644 --- a/email_in.pl +++ b/email_in.pl @@ -56,45 +56,6 @@ use Bugzilla::Util; # in a message. RFC-compliant mailers use this. use constant SIGNATURE_DELIMITER => '-- '; -# These fields must all be defined or post_bug complains. They don't have -# to have values--they just have to be defined. There's not yet any -# way to require custom fields have values, for enter_bug, so we don't -# have to worry about those yet. -use constant REQUIRED_ENTRY_FIELDS => qw( - reporter - short_desc - product - component - version - - assigned_to - rep_platform - op_sys - priority - bug_severity - bug_file_loc -); - -# Fields that must be defined during process_bug. They *do* have to -# have values. The script will grab their values from the current -# bug object, if they're not specified. -use constant REQUIRED_PROCESS_FIELDS => qw( - dependson - blocked - version - product - target_milestone - rep_platform - op_sys - priority - bug_severity - bug_file_loc - component - short_desc - reporter_accessible - cclist_accessible -); - # $input_email is a global so that it can be used in die_handler. our ($input_email, %switch); @@ -180,15 +141,6 @@ sub post_bug { debug_print('Posting a new bug...'); - $fields{'rep_platform'} ||= Bugzilla->params->{'defaultplatform'}; - $fields{'op_sys'} ||= Bugzilla->params->{'defaultopsys'}; - $fields{'priority'} ||= Bugzilla->params->{'defaultpriority'}; - $fields{'bug_severity'} ||= Bugzilla->params->{'defaultseverity'}; - - foreach my $field (REQUIRED_ENTRY_FIELDS) { - $fields{$field} ||= ''; - } - my $cgi = Bugzilla->cgi; foreach my $field (keys %fields) { $cgi->param(-name => $field, -value => $fields{$field}); @@ -231,14 +183,6 @@ sub process_bug { $fields{'addtonewgroup'} = 0; } - foreach my $field (REQUIRED_PROCESS_FIELDS) { - my $value = $bug->$field; - if (ref $value) { - $value = join(',', @$value); - } - $fields{$field} ||= $value; - } - # Make it possible to remove CCs. if ($fields{'removecc'}) { $fields{'cc'} = [split(',', $fields{'removecc'})]; -- cgit v1.2.3-24-g4f1b