Commit 92129e72 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 391669: Modifying a bug via email_in.pl fails because there are many fields…

Bug 391669: Modifying a bug via email_in.pl fails because there are many fields that process_bug.cgi requires but aren't provided to it - Patch by Fré©ric Buclin <LpSolit@gmail.com> r=mkanat a=LpSolit
parent 4a3e07de
...@@ -213,22 +213,17 @@ sub process_bug { ...@@ -213,22 +213,17 @@ sub process_bug {
ValidateBugID($bug_id); ValidateBugID($bug_id);
my $bug = new Bugzilla::Bug($bug_id); my $bug = new Bugzilla::Bug($bug_id);
if ($fields{'assigned_to'}) { if ($fields{'bug_status'}) {
$fields{'knob'} = 'reassign'; $fields{'knob'} = $fields{'bug_status'};
} }
if (my $status = $fields{'bug_status'}) { # If no status is given, then we only want to change the resolution.
$fields{'knob'} = 'confirm' if $status =~ /NEW/i; elsif ($fields{'resolution'}) {
$fields{'knob'} = 'accept' if $status =~ /ASSIGNED/i; $fields{'knob'} = 'change_resolution';
$fields{'knob'} = 'clearresolution' if $status =~ /REOPENED/i; $fields{'resolution_knob_change_resolution'} = $fields{'resolution'};
$fields{'knob'} = 'verify' if $status =~ /VERIFIED/i;
$fields{'knob'} = 'close' if $status =~ /CLOSED/i;
} }
if ($fields{'dup_id'}) { if ($fields{'dup_id'}) {
$fields{'knob'} = 'duplicate'; $fields{'knob'} = 'duplicate';
} }
if ($fields{'resolution'}) {
$fields{'knob'} = 'resolve';
}
# Make sure we don't get prompted if we have to change the default # Make sure we don't get prompted if we have to change the default
# groups. # groups.
......
...@@ -488,12 +488,14 @@ if (!$cgi->param('id') && $cgi->param('dup_id')) { ...@@ -488,12 +488,14 @@ if (!$cgi->param('id') && $cgi->param('dup_id')) {
foreach my $b (@bug_objects) { foreach my $b (@bug_objects) {
if (should_set('knob')) { if (should_set('knob')) {
# First, get the correct resolution <select>, in case there is more # First, get the correct resolution <select>, in case there is more
# than one open -> closed transition allowed. # than one open -> closed transition allowed. Allow to fallback to
# 'resolution' (useful when called from email_in.pl).
my $knob = $cgi->param('knob'); my $knob = $cgi->param('knob');
my $status = new Bugzilla::Status({name => $knob}); my $status = new Bugzilla::Status({name => $knob});
my $resolution; my $resolution;
if ($status) { if ($status) {
$resolution = $cgi->param('resolution_knob_' . $status->id); $resolution = $cgi->param('resolution_knob_' . $status->id)
|| $cgi->param('resolution');
} }
else { else {
$resolution = $cgi->param('resolution_knob_change_resolution'); $resolution = $cgi->param('resolution_knob_change_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