Commit 5bf043ee authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 466406: Passing an empty comment to Bug.add_comment fails silently

Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat
parent bb9d68e2
...@@ -29,6 +29,7 @@ use Bugzilla::Field; ...@@ -29,6 +29,7 @@ use Bugzilla::Field;
use Bugzilla::WebService::Constants; use Bugzilla::WebService::Constants;
use Bugzilla::Bug; use Bugzilla::Bug;
use Bugzilla::BugMail; use Bugzilla::BugMail;
use Bugzilla::Util qw(trim);
############# #############
# Constants # # Constants #
...@@ -233,7 +234,7 @@ sub add_comment { ...@@ -233,7 +234,7 @@ sub add_comment {
defined $params->{id} defined $params->{id}
|| ThrowCodeError('param_required', { param => 'id' }); || ThrowCodeError('param_required', { param => 'id' });
my $comment = $params->{comment}; my $comment = $params->{comment};
defined $comment (defined $comment && trim($comment) ne '')
|| ThrowCodeError('param_required', { param => 'comment' }); || ThrowCodeError('param_required', { param => 'comment' });
my $bug = Bugzilla::Bug->check($params->{id}); my $bug = Bugzilla::Bug->check($params->{id});
...@@ -655,6 +656,8 @@ This allows you to add a comment to a bug in Bugzilla. ...@@ -655,6 +656,8 @@ This allows you to add a comment to a bug in Bugzilla.
comment to. comment to.
=item C<comment> (string) B<Required> - The comment to append to the bug. =item C<comment> (string) B<Required> - The comment to append to the bug.
If this is empty or all whitespace, an error will be thrown saying that
you did not set the C<comment> parameter.
=item C<private> (boolean) - If set to true, the comment is private, otherwise =item C<private> (boolean) - If set to true, the comment is private, otherwise
it is assumed to be public. it is assumed to be public.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment