summaryrefslogtreecommitdiffstats
path: root/extensions/GuidedBugEntry
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-05-01 10:15:09 +0200
committerByron Jones <bjones@mozilla.com>2013-05-01 10:15:09 +0200
commit78fbce5bf3e5faed12b8360bc8e21b8a293d5371 (patch)
tree6a90eaf6a152f35c29b2cae90446054733efe5cd /extensions/GuidedBugEntry
parentb2f7765446bb382ff0716785832c4135f695b498 (diff)
downloadbugzilla-78fbce5bf3e5faed12b8360bc8e21b8a293d5371.tar.gz
bugzilla-78fbce5bf3e5faed12b8360bc8e21b8a293d5371.tar.xz
Bug 867520: guided bug entry doesn't honour the default bug format
Diffstat (limited to 'extensions/GuidedBugEntry')
-rw-r--r--extensions/GuidedBugEntry/Extension.pm18
-rw-r--r--extensions/GuidedBugEntry/template/en/default/pages/guided_products.js.tmpl8
2 files changed, 14 insertions, 12 deletions
diff --git a/extensions/GuidedBugEntry/Extension.pm b/extensions/GuidedBugEntry/Extension.pm
index 5665e18ae..127a93a8e 100644
--- a/extensions/GuidedBugEntry/Extension.pm
+++ b/extensions/GuidedBugEntry/Extension.pm
@@ -14,6 +14,7 @@ use Bugzilla::Error;
use Bugzilla::Status;
use Bugzilla::Util 'url_quote';
use Bugzilla::UserAgent;
+use Bugzilla::Extension::BMO::Data;
our $VERSION = '1';
@@ -92,9 +93,6 @@ sub _init_vars {
$vars->{'platform'} = detect_platform();
$vars->{'op_sys'} = detect_op_sys();
-
- eval 'use Bugzilla::Extension::BMO::Data';
- $vars->{'BMO'} = $@ ? 0 : 1;
}
sub page_before_template {
@@ -104,13 +102,17 @@ sub page_before_template {
return unless $page eq 'guided_products.js';
- # import product -> security group mappings from the BMO ext
+ # import data from the BMO ext
- our %product_sec_groups;
- eval q#use Bugzilla::Extension::BMO::Data '%product_sec_groups'#;
- return if $@;
+ $vars->{'product_sec_groups'} = \%product_sec_groups;
- $vars->{'products'} = \%product_sec_groups;
+ my %bug_formats;
+ foreach my $product (keys %create_bug_formats) {
+ if (my $format = Bugzilla::Extension::BMO::forced_format($product)) {
+ $bug_formats{$product} = $format;
+ }
+ }
+ $vars->{'create_bug_formats'} = \%bug_formats;
}
__PACKAGE__->NAME;
diff --git a/extensions/GuidedBugEntry/template/en/default/pages/guided_products.js.tmpl b/extensions/GuidedBugEntry/template/en/default/pages/guided_products.js.tmpl
index 268fe06f8..b58df8298 100644
--- a/extensions/GuidedBugEntry/template/en/default/pages/guided_products.js.tmpl
+++ b/extensions/GuidedBugEntry/template/en/default/pages/guided_products.js.tmpl
@@ -8,16 +8,16 @@
[%# this file allows us to pull in data defined in the BMO ext %]
-[% IF formats %]
- [% FOREACH product = formats %]
+[% IF create_bug_formats %]
+ [% FOREACH product = create_bug_formats %]
if (!products['[% product.key FILTER js %]']) [% ~%]
products['[% product.key FILTER js %]'] = {};
products['[% product.key FILTER js %]'].format = '[% product.value FILTER js %]';
[% END %]
[% END %]
-[% IF products %]
- [% FOREACH product = products %]
+[% IF product_sec_groups %]
+ [% FOREACH product = product_sec_groups %]
if (!products['[% product.key FILTER js %]']) [% ~%]
products['[% product.key FILTER js %]'] = {};
products['[% product.key FILTER js %]'].secgroup = '[% product.value FILTER js %]';