summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authorDavid Lawrence <dlawrence@mozilla.com>2011-10-24 22:57:11 +0200
committerDavid Lawrence <dlawrence@mozilla.com>2011-10-24 22:57:11 +0200
commit3fa19c4c0f396ffe3a048ce6cbbd04c6e8bca6d0 (patch)
treec75bdc1df36d7bcd5865de32678b2fb015287b1b /Bugzilla/Bug.pm
parentb2af914ec824e3c7b3773c0ffd9d9a7e08290caf (diff)
parentd47f6057e0257b3282ff25a144b9ef36ec741012 (diff)
downloadbugzilla-3fa19c4c0f396ffe3a048ce6cbbd04c6e8bca6d0.tar.gz
bugzilla-3fa19c4c0f396ffe3a048ce6cbbd04c6e8bca6d0.tar.xz
merged with bugzilla/4.2
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm16
1 files changed, 9 insertions, 7 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 26d2a89f3..42a7f7f15 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -2690,20 +2690,22 @@ sub add_comment {
$params ||= {};
- # This makes it so we won't create new comments when there is nothing
- # to add
- if ($comment eq '' && !($params->{type} || abs($params->{work_time} || 0))) {
- return;
- }
-
# Fill out info that doesn't change and callers may not pass in
$params->{'bug_id'} = $self;
- $params->{'thetext'} = $comment;
+ $params->{'thetext'} = defined($comment) ? $comment : '';
# Validate all the entered data
Bugzilla::Comment->check_required_create_fields($params);
$params = Bugzilla::Comment->run_create_validators($params);
+ # This makes it so we won't create new comments when there is nothing
+ # to add
+ if ($params->{'thetext'} eq ''
+ && !($params->{type} || abs($params->{work_time} || 0)))
+ {
+ return;
+ }
+
# If the user has explicitly set remaining_time, this will be overridden
# later in set_all. But if they haven't, this keeps remaining_time
# up-to-date.