summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Mello <timello@gmail.com>2011-10-19 01:08:39 -0200
committerTiago Mello <timello@gmail.com>2011-10-19 01:08:39 -0200
commit6c418d66ecdc4bf7a10b170cfc0a67512e5166fb (patch)
treef6b9623c05aa5171e131f2866b8e903c6112936b /Bugzilla/Bug.pm
parentBug 689862: Fix Product.get to only return the Classification name, (diff)
downloadbugzilla-6c418d66ecdc4bf7a10b170cfc0a67512e5166fb.tar.gz
bugzilla-6c418d66ecdc4bf7a10b170cfc0a67512e5166fb.tar.bz2
bugzilla-6c418d66ecdc4bf7a10b170cfc0a67512e5166fb.zip
Bug 686963: Setting the work time using the Bug.update WebService method
requires a comment. r/a=LpSolit
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 ed77cc50d..aee551a12 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -2671,20 +2671,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.