Bug 87006 - Allow empty worktime-only comments

git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@1465 6955db30-a419-402b-8a0d-67ecbb4d7f56
master
vfilippov 2011-11-22 16:36:23 +00:00
parent d539ab44c4
commit c0c6d59bd3
1 changed files with 7 additions and 2 deletions

View File

@ -2506,8 +2506,13 @@ sub add_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;
if ($comment eq '' && $params->{work_time} != 0 &&
(!exists $params->{type} ||
$params->{type} != CMT_WORKTIME &&
$params->{type} != CMT_BACKDATED_WORKTIME))
{
ThrowUserError('comment_required');
}
}
if (exists $params->{type}) {
$params->{type} = $self->_check_comment_type($params->{type});