summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Product.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/Bugzilla/Product.pm b/Bugzilla/Product.pm
index 1db5e79b3..ddf60177d 100644
--- a/Bugzilla/Product.pm
+++ b/Bugzilla/Product.pm
@@ -105,7 +105,9 @@ sub create {
my $params = $class->run_create_validators(@_);
# 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 $create_series = delete $params->{create_series};
@@ -113,7 +115,8 @@ sub create {
# Add the new version and milestone into the DB as valid values.
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.
$product->_create_bug_group() if Bugzilla->params->{'makeproductgroups'};