summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-05-13 08:28:30 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-05-13 08:28:30 +0200
commit20ed8a92744b90c7b6b5eab19d0ed7e846100a5e (patch)
tree9ec9e682988da71c45b1232b49ad4acfd1d7bd27 /Bugzilla/Bug.pm
parent72d9f52a212e557110622b37e81027458ceb3ecb (diff)
downloadbugzilla-20ed8a92744b90c7b6b5eab19d0ed7e846100a5e.tar.gz
bugzilla-20ed8a92744b90c7b6b5eab19d0ed7e846100a5e.tar.xz
Bug 556123: process_bug.cgi: move the setting of comments and work_time
into Bugzilla::Bug::set_all r=dkl, a=mkanat
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index c0c2d97ff..b9c64da7f 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -1848,6 +1848,27 @@ sub _set_global_validator {
# "Set" Methods #
#################
+sub set_all {
+ my $self = shift;
+ my ($params) = @_;
+
+ if (exists $params->{'comment'} or exists $params->{'work_time'}) {
+ # Add a comment as needed to each bug. This is done early because
+ # there are lots of things that want to check if we added a comment.
+ $self->add_comment($params->{'comment'}->{'body'},
+ { isprivate => $params->{'comment'}->{'is_private'},
+ work_time => $params->{'work_time'} });
+ }
+
+ my %normal_set_all;
+ foreach my $name (keys %$params) {
+ if ($self->can("set_$name")) {
+ $normal_set_all{$name} = $params->{$name};
+ }
+ }
+ $self->SUPER::set_all(\%normal_set_all);
+}
+
sub set_alias { $_[0]->set('alias', $_[1]); }
sub set_assigned_to {
my ($self, $value) = @_;