From: Kent Rogers Date: Wed, 26 May 2010 01:45:33 +0000 (-0700) Subject: Bug 271913: Don't force the user to comment when adding Hours Worked X-Git-Tag: bugzilla-3.7.1~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7beba3d36ed5071c7425b69db20db1dc93371343;p=thirdparty%2Fbugzilla.git Bug 271913: Don't force the user to comment when adding Hours Worked r=mkanat, a=mkanat --- diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index fb4972782a..008155800d 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -2407,11 +2407,7 @@ sub add_comment { $comment = $self->_check_comment($comment); $params ||= {}; - if (exists $params->{work_time}) { - $params->{work_time} = $self->_check_work_time($params->{work_time}); - ThrowUserError('comment_required') - if $comment eq '' && $params->{work_time} != 0; - } + $params->{work_time} = $self->_check_work_time($params->{work_time}); if (exists $params->{type}) { $params->{type} = $self->_check_comment_type($params->{type}); } @@ -2421,7 +2417,7 @@ sub add_comment { } # XXX We really should check extra_data, too. - if ($comment eq '' && !($params->{type} || $params->{work_time})) { + if ($comment eq '' && !($params->{type} || abs($params->{work_time}))) { return; } diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl index 2f42bbcb71..af6cc21911 100644 --- a/template/en/default/bug/comments.html.tmpl +++ b/template/en/default/bug/comments.html.tmpl @@ -89,6 +89,7 @@ [% BLOCK a_comment %] [% RETURN IF comment.is_private AND ! user.is_insider %] + [% RETURN IF comment.body == '' AND comment.work_time != 0 AND !user.is_timetracker %]