summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Panteleev <github.private@thecybershadow.net>2018-04-08 18:07:15 +0200
committerDylan William Hardison <dylan@hardison.net>2018-04-08 18:07:15 +0200
commit922c09396817fece1275365a474e5cbde6e1f99e (patch)
tree680b7ca0bd449e6d40cc701e3480be7e2d31a536
parentb699c8deaa16d0f7d6929164d0f5e68895453562 (diff)
downloadbugzilla-922c09396817fece1275365a474e5cbde6e1f99e.tar.gz
bugzilla-922c09396817fece1275365a474e5cbde6e1f99e.tar.xz
enter_bug: Fix hard BMO dependency (#29)
The default_platform and default_op_sys Bugzilla::Product methods are installed by the BMO extension, so don't attempt to invoke them when it isn't present.
-rwxr-xr-xenter_bug.cgi11
1 files changed, 9 insertions, 2 deletions
diff --git a/enter_bug.cgi b/enter_bug.cgi
index 33cdf8535..5b8a97dba 100755
--- a/enter_bug.cgi
+++ b/enter_bug.cgi
@@ -37,6 +37,8 @@ use Bugzilla::Field;
use Bugzilla::Status;
use Bugzilla::UserAgent;
+use List::Util qw(any);
+
my $user = Bugzilla->login(LOGIN_REQUIRED);
my $cloned_bug;
@@ -299,8 +301,13 @@ else {
$default{'bug_severity'} = formvalue('bug_severity', Bugzilla->params->{'defaultseverity'});
# BMO - use per-product default hw/os
- $default{'rep_platform'} = formvalue('rep_platform', $product->default_platform // detect_platform());
- $default{'op_sys'} = formvalue('op_sys', $product->default_op_sys // detect_op_sys());
+ if (any { $_->NAME eq 'BMO' } @{ Bugzilla->extensions }) {
+ $default{'rep_platform'} = formvalue('rep_platform', $product->default_platform // detect_platform());
+ $default{'op_sys'} = formvalue('op_sys', $product->default_op_sys // detect_op_sys());
+ } else {
+ $default{'rep_platform'} = formvalue('rep_platform', detect_platform());
+ $default{'op_sys'} = formvalue('op_sys', detect_op_sys());
+ }
$vars->{'rep_platform'} = detect_platform();
$vars->{'rep_op_sys'} = detect_op_sys();