aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2007-07-07 15:58:27 +0000
committerlpsolit%gmail.com <>2007-07-07 15:58:27 +0000
commit86a9c38e75690e12e39a3363093be6af78fbe087 (patch)
tree5dfb141bba5c8e9a6a61aa313b96c4b324a2c42f
parent92c064fb79e9b1f7236ac82e1ed9724c65b95b5e (diff)
downloadbugs-86a9c38e75690e12e39a3363093be6af78fbe087.tar
bugs-86a9c38e75690e12e39a3363093be6af78fbe087.tar.gz
bugs-86a9c38e75690e12e39a3363093be6af78fbe087.tar.bz2
bugs-86a9c38e75690e12e39a3363093be6af78fbe087.tar.xz
bugs-86a9c38e75690e12e39a3363093be6af78fbe087.zip
Bug 376427: Exported XML files contain the incorrect status and resolution (they are always set to RESOLVED MOVED) - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=LpSolit
-rwxr-xr-xprocess_bug.cgi19
1 files changed, 11 insertions, 8 deletions
diff --git a/process_bug.cgi b/process_bug.cgi
index d8620d138..5cdb14e66 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -59,6 +59,8 @@ use Bugzilla::Component;
use Bugzilla::Keyword;
use Bugzilla::Flag;
+use Storable qw(dclone);
+
my $user = Bugzilla->login(LOGIN_REQUIRED);
local our $whoid = $user->id;
my $grouplist = $user->groups_as_string;
@@ -474,18 +476,19 @@ if ($action eq Bugzilla->params->{'move-button-text'}) {
'cc READ', 'fielddefs READ', 'bug_status READ',
'status_workflow READ', 'resolution READ');
- my @bugs;
# First update all moved bugs.
- foreach my $id (@idlist) {
- my $bug = new Bugzilla::Bug($id);
- push(@bugs, $bug);
- $bug->add_comment(scalar $cgi->param('comment'),
+ foreach my $bug (@bug_objects) {
+ $bug->add_comment(scalar $cgi->param('comment'),
{ type => CMT_MOVED_TO, extra_data => $user->login });
+ }
+ # Don't export the new status and resolution. We want the current ones.
+ local $Storable::forgive_me = 1;
+ my $bugs = dclone(\@bug_objects);
+ foreach my $bug (@bug_objects) {
$bug->set_status('RESOLVED');
$bug->set_resolution('MOVED');
}
-
- $_->update() foreach @bugs;
+ $_->update() foreach @bug_objects;
$dbh->bz_unlock_tables();
# Now send emails.
@@ -511,7 +514,7 @@ if ($action eq Bugzilla->params->{'move-button-text'}) {
$displayfields{$_} = 1;
}
- $template->process("bug/show.xml.tmpl", { bugs => \@bugs,
+ $template->process("bug/show.xml.tmpl", { bugs => $bugs,
displayfields => \%displayfields,
}, \$msg)
|| ThrowTemplateError($template->error());