Closed Bug 522404 Opened 16 years ago Closed 16 years ago

Cannot create components for multiple products in a row in one script

Categories

(Bugzilla :: Administration, task, P1)

Tracking

()

RESOLVED FIXED
Bugzilla 3.6

People

(Reporter: mkanat, Assigned: mkanat)

References

Details

(Whiteboard: [es-lambda])

Attachments

(1 file, 1 obsolete file)

Attached patch v1 (obsolete) — Splinter Review
When creating or updating a product, all cached data about products in the current Bugzilla->user object should be removed. (Otherwise, you can't really create components for two products in a row in the same script, because selectable_products doesn't know that the second product exists, and you get an error.)
Attachment #406372 - Flags: review?(dkl)
Whiteboard: [es-lambda]
This is more of a bug, and actually, the above patch doesn't seem to fix it yet. I'll investigate.
Severity: enhancement → minor
Status: NEW → ASSIGNED
Summary: Product->update and Product->create should clear $user->selectable_products, etc. → Cannot create components for multiple products in a row in one script
Assignee: administration → mkanat
Attached patch v2Splinter Review
Okay, the problem was that anything could have called get_selectable_products in between the first time we created a product and the second time we're trying to create a product. In my case, it was Bugzilla::Component->create calling it. There's no way to know what's going to call it. The only truly reliable thing to do is to clear the cache immediately after inserting a product into the database, which I do here, and which works.
Attachment #406372 - Attachment is obsolete: true
Attachment #406376 - Flags: review?(dkl)
Attachment #406372 - Flags: review?(dkl)
Priority: -- → P1
Comment on attachment 406376 [details] [diff] [review] v2 I have tested this patch and all works as described when creating new product and new component using a test script I wrote. Also normal activities work using the product admin UI. r=dkl
Attachment #406376 - Flags: review?(dkl) → review+
Flags: approval?
Thanks, dkl! :-)
Flags: approval? → approval+
Checking in Bugzilla/Product.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Product.pm,v <-- Product.pm new revision: 1.40; previous revision: 1.39 done Checking in Bugzilla/User.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/User.pm,v <-- User.pm new revision: 1.193; previous revision: 1.192 done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: