Closed Bug 686963 Opened 13 years ago Closed 13 years ago

Setting the work time using the Bug.update WebService method requires a comment

Categories

(Bugzilla :: WebService, defect)

4.1.3
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.2

People

(Reporter: LpSolit, Assigned: timello)

References

Details

(Keywords: regression)

Attachments

(1 file)

Since Bugzilla 4.0 (bug 271913), a comment is no longer required when setting the work time. This is working fine from the web UI for 4.0 and 4.2, and is also working fine from the WebService API in 4.0, but this is no longer working in 4.2. If you don't specify a comment at the same time as you specify work_time, you get the following error: The function Bugzilla::Comment->create requires a thetext argument, and that argument was not set. I'm pretty sure this is a regression due to bug 590334.
Flags: blocking4.2+
Assignee: webservice → timello
Attached patch v1Splinter Review
Ok, this patch fixes 2 problems because there were related: 1. Comments with white-spaces where allowed to be added because we were running the validators after the code actually we skip blank comments; 2. $params->{thetext} should not be undefined, otherwise _check_thetext() validator will complain.
Attachment #567888 - Flags: review?(LpSolit)
Status: NEW → ASSIGNED
Comment on attachment 567888 [details] [diff] [review] v1 >+ $params->{'thetext'} = $comment || ''; As '0' is a valid comment, you must replace the line above by: $params->{'thetext'} = defined($comment) ? $comment : ''; r=LpSolit with this change.
Attachment #567888 - Flags: review?(LpSolit) → review+
Do not forget the fix on checkin.
Flags: approval4.2+
Flags: approval+
(In reply to Frédéric Buclin from comment #2) > Comment on attachment 567888 [details] [diff] [review] [diff] [details] [review] > v1 > > >+ $params->{'thetext'} = $comment || ''; > > As '0' is a valid comment, you must replace the line above by: > > $params->{'thetext'} = defined($comment) ? $comment : ''; Indeed! Thanks!
Committing to: bzr+ssh://timello%40gmail.com@bzr.mozilla.org/bugzilla/4.2/ modified Bugzilla/Bug.pm Committed revision 7948. Committing to: bzr+ssh://timello%40gmail.com@bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla/Bug.pm Committed revision 7986.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment on attachment 567888 [details] [diff] [review] v1 Review of attachment 567888 [details] [diff] [review]: ----------------------------------------------------------------- ::: Bugzilla/Bug.pm @@ +2674,3 @@ > # Fill out info that doesn't change and callers may not pass in > $params->{'bug_id'} = $self; > + $params->{'thetext'} = $comment || ''; "0" is a valid comment.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: