]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 391669: Modifying a bug via email_in.pl fails because there are many fields that...
authorlpsolit%gmail.com <>
Thu, 24 Jan 2008 03:49:31 +0000 (03:49 +0000)
committerlpsolit%gmail.com <>
Thu, 24 Jan 2008 03:49:31 +0000 (03:49 +0000)
email_in.pl
process_bug.cgi

index 13e81e77eb12001cef659aa94cce1dc1ce74579b..02d00a3e215c3bab6cb42304c3e12e5837c7cd07 100644 (file)
@@ -213,22 +213,17 @@ sub process_bug {
     ValidateBugID($bug_id);
     my $bug = new Bugzilla::Bug($bug_id);
 
-    if ($fields{'assigned_to'}) {
-        $fields{'knob'} = 'reassign';
+    if ($fields{'bug_status'}) {
+        $fields{'knob'} = $fields{'bug_status'};
     }
-    if (my $status = $fields{'bug_status'}) {
-        $fields{'knob'} = 'confirm' if $status =~ /NEW/i;
-        $fields{'knob'} = 'accept'  if $status =~ /ASSIGNED/i;
-        $fields{'knob'} = 'clearresolution' if $status =~ /REOPENED/i;
-        $fields{'knob'} = 'verify'  if $status =~ /VERIFIED/i;
-        $fields{'knob'} = 'close'   if $status =~ /CLOSED/i;
+    # If no status is given, then we only want to change the resolution.
+    elsif ($fields{'resolution'}) {
+        $fields{'knob'} = 'change_resolution';
+        $fields{'resolution_knob_change_resolution'} = $fields{'resolution'};
     }
     if ($fields{'dup_id'}) {
         $fields{'knob'} = 'duplicate';
     }
-    if ($fields{'resolution'}) {
-        $fields{'knob'} = 'resolve';
-    }
 
     # Make sure we don't get prompted if we have to change the default
     # groups.
index 3f223542227afc130cea60549cb16a33b8fdb568..912440ce278e8f80a0fe1315621070f082a166cc 100755 (executable)
@@ -488,12 +488,14 @@ if (!$cgi->param('id') && $cgi->param('dup_id')) {
 foreach my $b (@bug_objects) {
     if (should_set('knob')) {
         # 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 $status = new Bugzilla::Status({name => $knob});
         my $resolution;
         if ($status) {
-            $resolution = $cgi->param('resolution_knob_' . $status->id);
+            $resolution = $cgi->param('resolution_knob_' . $status->id)
+                          || $cgi->param('resolution');
         }
         else {
             $resolution = $cgi->param('resolution_knob_change_resolution');