summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2014-12-17 20:37:55 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2014-12-17 20:37:55 +0100
commit0598a0af385f90fdbc6f7a59fb5edb007394b73c (patch)
tree4a840f5e56d39368fa0e2f80d0a82d90ed9baad2 /Bugzilla
parent04fd938b807c7bff0052d55930cfc4540f00a5b5 (diff)
downloadbugzilla-0598a0af385f90fdbc6f7a59fb5edb007394b73c.tar.gz
bugzilla-0598a0af385f90fdbc6f7a59fb5edb007394b73c.tar.xz
Bug 1111043: Bug.add_comment returns the wrong comment ID
r=dkl a=glob
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/WebService/Bug.pm15
1 files changed, 3 insertions, 12 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index de358b1e0..3d7ff3804 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -981,19 +981,10 @@ sub add_comment {
$bug->add_comment($comment, { isprivate => $params->{is_private},
is_markdown => $params->{is_markdown},
work_time => $params->{work_time} });
-
- # Capture the call to bug->update (which creates the new comment) in
- # a transaction so we're sure to get the correct comment_id.
-
- my $dbh = Bugzilla->dbh;
- $dbh->bz_start_transaction();
-
$bug->update();
-
- my $new_comment_id = $dbh->bz_last_key('longdescs', 'comment_id');
-
- $dbh->bz_commit_transaction();
-
+
+ my $new_comment_id = $bug->{added_comments}[0]->id;
+
# Send mail.
Bugzilla::BugMail::Send($bug->bug_id, { changer => $user });