Commit 13e17b22 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 522396: Bugzilla::Product->create should do better with missing input fields

Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=dkl, a=mkanat
parent 700f6a06
...@@ -105,7 +105,9 @@ sub create { ...@@ -105,7 +105,9 @@ sub create {
my $params = $class->run_create_validators(@_); my $params = $class->run_create_validators(@_);
# Some fields do not exist in the DB as is. # Some fields do not exist in the DB as is.
$params->{classification_id} = delete $params->{classification}; if (defined $params->{classification}) {
$params->{classification_id} = delete $params->{classification};
}
my $version = delete $params->{version}; my $version = delete $params->{version};
my $create_series = delete $params->{create_series}; my $create_series = delete $params->{create_series};
...@@ -113,7 +115,8 @@ sub create { ...@@ -113,7 +115,8 @@ sub create {
# Add the new version and milestone into the DB as valid values. # Add the new version and milestone into the DB as valid values.
Bugzilla::Version->create({name => $version, product => $product}); Bugzilla::Version->create({name => $version, product => $product});
Bugzilla::Milestone->create({name => $params->{defaultmilestone}, product => $product}); Bugzilla::Milestone->create({ name => $product->default_milestone,
product => $product });
# Create groups and series for the new product, if requested. # Create groups and series for the new product, if requested.
$product->_create_bug_group() if Bugzilla->params->{'makeproductgroups'}; $product->_create_bug_group() if Bugzilla->params->{'makeproductgroups'};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment