summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-10-23 00:33:34 +0200
committermkanat%bugzilla.org <>2009-10-23 00:33:34 +0200
commit13e17b221c37a1eea1d86aec07b72ee70bf52487 (patch)
tree0fef8ccfd3888b95a7c8350c7d361ce6fe852aff
parent700f6a062970e2c23510e3f6a47c88e069047a04 (diff)
downloadbugzilla-13e17b221c37a1eea1d86aec07b72ee70bf52487.tar.gz
bugzilla-13e17b221c37a1eea1d86aec07b72ee70bf52487.tar.xz
Bug 522396: Bugzilla::Product->create should do better with missing input fields
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=dkl, a=mkanat
-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'};