Closed Bug 682317 Opened 15 years ago Closed 14 years ago

Bug.create is incorrectly documented as ignoring invalid fields; it should say it produces an error

Categories

(Bugzilla :: WebService, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.6

People

(Reporter: gerv, Assigned: koosha.khajeh)

Details

Attachments

(1 file)

http://www.bugzilla.org/docs/4.0/en/html/api/Bugzilla/WebService/Bug.html#Bug_Creation_and_Modification says of Bug.create: "This allows you to create a new bug in Bugzilla. If you specify any invalid fields, they will be ignored. If you specify any fields you are not allowed to set, they will just be set to their defaults or ignored." However, when I try this using the BzAPI test suite, I get the following response from Bugzilla: Aug 26 17:44:03 [ERROR] $VAR1 = { 'error' => 1, 'code' => '53', 'message' => 'see_also is not a valid parameter for the Bugzilla::Bug::create function.' }; I have tested both with 3.4 and 4.0. We need to either fix the implementation, or update the documentation (which has said this incorrect statement since 3.2). Gerv
That documentation was right only before we fixed the SQL injection, so yes, the documentation should be fixed on every branch where the SQL injection was fixed.
OS: Linux → All
Hardware: x86 → All
mkanat: to be clear, you are saying that it is by design that Bug.create barfs on invalid fields, and the docs are wrong? Gerv
(In reply to Gervase Markham [:gerv] from comment #2) > mkanat: to be clear, you are saying that it is by design that Bug.create > barfs on invalid fields, and the docs are wrong? Yeah.
Summary: Bug.create does not ignore invalid fields → Bug.create is incorrectly documented as ignoring invalid fields; it should say it produces an error
Attached patch patch - v1 — — Splinter Review
Attachment #648525 - Flags: review?(dkl)
Attachment #648525 - Flags: review?(LpSolit)
Comment on attachment 648525 [details] [diff] [review] patch - v1 Review of attachment 648525 [details] [diff] [review]: ----------------------------------------------------------------- Fix on checkin. r=dkl ::: Bugzilla/WebService/Bug.pm @@ +2391,4 @@ > =item B<Description> > > This allows you to create a new bug in Bugzilla. If you specify any > +invalid field, an error will be thrown signifying the invalidity If you specify any invalid fields, an error will be thrown stating which field is invalid.
Attachment #648525 - Flags: review?(dkl) → review+
Flags: approval?
Attachment #648525 - Flags: review?(LpSolit)
Approved for all supported branches, as gerv said that all branches since 3.2 throw an error with invalid fields.
Assignee: webservice → koosha.khajeh
Status: NEW → ASSIGNED
Flags: approval?
Flags: approval4.2+
Flags: approval4.0+
Flags: approval3.6+
Flags: approval+
Target Milestone: --- → Bugzilla 3.6
Committing to: bzr+ssh://dlawrence%40mozilla.com@bzr.mozilla.org/bugzilla/trunk modified Bugzilla/WebService/Bug.pm Committed revision 8329. Committing to: bzr+ssh://dlawrence%40mozilla.com@bzr.mozilla.org/bugzilla/4.2 modified Bugzilla/WebService/Bug.pm Committed revision 8113. Committing to: bzr+ssh://dlawrence%40mozilla.com@bzr.mozilla.org/bugzilla/4.0 modified Bugzilla/WebService/Bug.pm Committed revision 7717. Committing to: bzr+ssh://dlawrence%40mozilla.com@bzr.mozilla.org/bugzilla/3.6 modified Bugzilla/WebService/Bug.pm Committed revision 7294.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: