summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2012-11-20 07:38:36 +0100
committerByron Jones <bjones@mozilla.com>2012-11-20 07:38:36 +0100
commit2cfc2817d82789162a99aaffe37200cb3b440853 (patch)
treed104c42668262b7e1b29b87ae547b9a37fc6e82a
parent9f7b24e9b70f736c700674e1929fe1344c6e4351 (diff)
downloadbugzilla-2cfc2817d82789162a99aaffe37200cb3b440853.tar.gz
bugzilla-2cfc2817d82789162a99aaffe37200cb3b440853.tar.xz
Bug 812420: When creating a needinfo request and a comment at the same time, comment is added twice
-rw-r--r--Bugzilla/Bug.pm4
-rw-r--r--extensions/Needinfo/Extension.pm7
2 files changed, 5 insertions, 6 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index f8566be4a..6973ae2fc 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -781,6 +781,10 @@ sub update {
my ($changes, $old_bug) = $self->SUPER::update(@_);
+ Bugzilla::Hook::process('bug_start_of_update',
+ { timestamp => $delta_ts, bug => $self,
+ old_bug => $old_bug, changes => $changes });
+
# Certain items in $changes have to be fixed so that they hold
# a name instead of an ID.
foreach my $field (qw(product_id component_id)) {
diff --git a/extensions/Needinfo/Extension.pm b/extensions/Needinfo/Extension.pm
index 2958031be..7999d6ae7 100644
--- a/extensions/Needinfo/Extension.pm
+++ b/extensions/Needinfo/Extension.pm
@@ -10,7 +10,6 @@ use strict;
use base qw(Bugzilla::Extension);
-use Bugzilla::Bug;
use Bugzilla::User;
use Bugzilla::Flag;
use Bugzilla::FlagType;
@@ -49,7 +48,7 @@ sub install_update_db {
# Clear the needinfo? flag if comment is being given by
# requestee or someone used the override flag.
-sub bug_end_of_update {
+sub bug_start_of_update {
my ($self, $args) = @_;
my $bug = $args->{bug};
my $old_bug = $args->{old_bug};
@@ -157,7 +156,6 @@ sub bug_end_of_update {
my $field = 'flagtypes.name';
$removed = defined $removed ? $removed : '';
$added = defined $added ? $added : '';
- LogActivityEntry($bug->id, $field, $removed, $added, $user->id, $timestamp);
# Do not overwrite other flag changes
if ($changes->{$field}) {
@@ -169,9 +167,6 @@ sub bug_end_of_update {
: $added;
}
$changes->{$field} = [$removed, $added];
-
- # Adding a flag may result in CC'ing a user, call update to process
- $bug->update() if $added;
}
}
}