Closed Bug 620796 Opened 14 years ago Closed 14 years ago

Bugzilla::Migrate->create_legal_values chokes trying to create components

Categories

(Bugzilla :: Bug Import/Export & Moving, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED
Bugzilla 4.0

People

(Reporter: eevee, Assigned: mkanat)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20101221 Firefox-4.0/4.0b9pre
Build Identifier: 3.7.3

create_legal_values attempts to create missing values for every Bugzilla choice field, by using:

Bugzilla::Field::Choice->type($field)->new({ name => $value });

But this call doesn't work for components; they require both a name and a product.  Thus migrate.pl promptly chokes and dies at this step.

Teeny backtrace:
Bad argument product sent to Bugzilla::Component::new function.
 at Bugzilla/Component.pm line 86
        Bugzilla::Component::new(...) called at Bugzilla/Migrate.pm line 645
        Bugzilla::Migrate::create_legal_values(...) called at Bugzilla/Migrate.pm line 184
        Bugzilla::Migrate::do_migration(...) called at ./migrate.pl line 53

Reproducible: Always
Attached patch v1Splinter Review
This should fix it. Can you confirm that this fixes it? Then I'll check it in to the 4.0 branch and trunk. (I'm granting myself review as the module owner for Migrate.)
Assignee: import-export → mkanat
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #499170 - Flags: review+
Severity: critical → major
Flags: approval4.0+
Flags: approval+
OS: Linux → All
Hardware: x86_64 → All
Target Milestone: --- → Bugzilla 4.0
Yep, works now.  (And then crashes *later*, but it's an improvement!)
Great, thanks!

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/                       
modified Bugzilla/Migrate.pm
Committed revision 7631.

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/4.0/                         
modified Bugzilla/Migrate.pm
Committed revision 7499.
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

Created:
Updated:
Size: