summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiago Mello <timello@gmail.com>2011-10-19 05:06:04 +0200
committerTiago Mello <timello@gmail.com>2011-10-19 05:06:04 +0200
commit0122a4e056b7f9c4f22d7c67ba9801f0c8c49d71 (patch)
tree640c20593f595159d5f3627da37a45e398812874
parent1b68b3315e62ca5c0f761f947db9ffadd91c435f (diff)
downloadbugzilla-0122a4e056b7f9c4f22d7c67ba9801f0c8c49d71.tar.gz
bugzilla-0122a4e056b7f9c4f22d7c67ba9801f0c8c49d71.tar.xz
Bug 686963: Setting the work time using the Bug.update WebService method
requires a comment. r/a=LpSolit
-rw-r--r--Bugzilla/Bug.pm16
1 files changed, 9 insertions, 7 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 175bcd050..515fabb90 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -2677,20 +2677,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.