diff options
author | Byron Jones <glob@mozilla.com> | 2015-04-21 08:00:18 +0200 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2015-04-21 08:00:18 +0200 |
commit | 5db6eeb9cf4bf82d785dd193703b46b2139247e5 (patch) | |
tree | 2cd234261c4cc56e4035b035b0fc20990ec9a6f6 /Bugzilla/Bug.pm | |
parent | 4aa44c46edf93a9707fc693769f39e5aeda7f59b (diff) | |
download | bugzilla-5db6eeb9cf4bf82d785dd193703b46b2139247e5.tar.gz bugzilla-5db6eeb9cf4bf82d785dd193703b46b2139247e5.tar.xz |
Bug 579089: Change default Hardware / OS values to be "Unspecified/Unspecified"
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r-- | Bugzilla/Bug.pm | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index e1f533274..6dbcffe34 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -702,10 +702,15 @@ sub create { unless defined $params->{bug_severity}; $params->{priority} = Bugzilla->params->{defaultpriority} unless defined $params->{priority}; - $params->{op_sys} = Bugzilla->params->{defaultopsys} - unless defined $params->{op_sys}; - $params->{rep_platform} = Bugzilla->params->{defaultplatform} - unless defined $params->{rep_platform}; + + # BMO - per-product hw/os defaults + if (!defined $params->{rep_platform} || !defined $params->{op_sys}) { + if (my $product = Bugzilla::Product->new({ name => $params->{product}, cache => 1 })) { + $params->{rep_platform} //= $product->default_product; + $params->{op_sys} //= $product->default_op_sys; + } + } + # Make sure a comment is always defined. $params->{comment} = '' unless defined $params->{comment}; |