Closed Bug 765315 Opened 14 years ago Closed 14 years ago

Mention the data type of 'product' param in POD of Bugzilla::Component->new to avoid misunderstanding

Categories

(Bugzilla :: Documentation, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
Bugzilla 4.4

People

(Reporter: koosha.khajeh, Assigned: koosha.khajeh)

Details

Attachments

(1 file, 3 obsolete files)

If you try to instantiate an object of an existing component by passing the hash ref {name => 'comp_name', product => 'product_name'} to Bugzilla::Component->new instead of an ID, an error will be thrown. The problem is at line 89: my @values = ($product->id, $name); where $product is a string and tries to call `id' method. This bug has been around for 6 years and it seems nobody has faced it yet!
Attached patch patch - v1 (obsolete) — Splinter Review
Attachment #633591 - Flags: review?(LpSolit)
Attachment #633591 - Flags: review?(LpSolit)
Attached patch patch - v1 (obsolete) — Splinter Review
Assignee: general → koosha.khajeh
Attachment #633591 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #633594 - Flags: review?(LpSolit)
I understand! product must be an object. Sorry!
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
Attachment #633594 - Flags: review?(LpSolit)
(In reply to Koosha Khajeh Moogahi [:koosha] from comment #3) > I understand! product must be an object. Sorry! That's what I was writing when you marked this bug as invalid. :)
Assignee: koosha.khajeh → general
Severity: blocker → normal
But, the misunderstanding was due to the fact that the data type of 'product' param was not mentioned in API docs. As the 'name' param is string, it is reasonable to expect 'product' to be string, too. The data type must be mentioned in the doc just like that of create(). I'm attaching a minor patch addressing this issue.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Summary: It is not possible to call Bugzilla::Component->new with 'name' & 'product' params → Mention the data type of 'product' param in POD of Bugzilla::Component->new to avoid misunderstanding
Attached patch POD modification (obsolete) — Splinter Review
Attachment #633594 - Attachment is obsolete: true
Attachment #633632 - Flags: review?(LpSolit)
(In reply to Koosha Khajeh Moogahi [:koosha] from comment #5) > But, the misunderstanding was due to the fact that the data type of > 'product' param was not mentioned in API docs. The type is mentioned. The description of the method says: "... a hash with the product object the component belongs to and the component name." "product object" is explicitly mentioned.
Comment on attachment 633632 [details] [diff] [review] POD modification > read in. If you pass in a hash with the 'name' > and 'product' keys, then the value of the name > key is the name of a component being in the given >- product. >+ product. Note that product must be an object of >+ Bugzilla::Product. I don't like the wording. I would much prefer something like: "If you pass in a hash, it must contain the following keys: - name (string): the name of the component. - product (object): the Bugzilla::Product object the component belongs to."
Attachment #633632 - Flags: review?(LpSolit) → review-
Assignee: general → documentation
Severity: normal → minor
Component: Bugzilla-General → Documentation
Target Milestone: --- → Bugzilla 4.4
Attachment #633632 - Attachment is obsolete: true
Attachment #633677 - Flags: review?(LpSolit)
Comment on attachment 633677 [details] [diff] [review] POD modification - 2 r=LpSolit
Attachment #633677 - Flags: review?(LpSolit) → review+
Assignee: documentation → koosha.khajeh
Status: REOPENED → ASSIGNED
Flags: approval+
No commit?!
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla/Component.pm Committed revision 8265.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago14 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: