summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2016-01-28 15:23:14 +0100
committerDavid Lawrence <dkl@mozilla.com>2016-01-28 15:23:14 +0100
commit3ec68d94eea63f789ce252e87c5d38f15503aa14 (patch)
tree1344df43652a89bcb8ebbf5e6c5412a8a9e9ead3
parentc3a3873b9ff0b2254a08a4dd987adcd8189569b0 (diff)
downloadbugzilla-3ec68d94eea63f789ce252e87c5d38f15503aa14.tar.gz
bugzilla-3ec68d94eea63f789ce252e87c5d38f15503aa14.tar.xz
Bug 1241667 - Trying to report a bug traps the user in an infinite loop
-rw-r--r--extensions/BMO/Extension.pm5
-rw-r--r--extensions/GuidedBugEntry/Extension.pm23
-rw-r--r--extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl2
3 files changed, 21 insertions, 9 deletions
diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm
index 67f7cc160..3ca3165fe 100644
--- a/extensions/BMO/Extension.pm
+++ b/extensions/BMO/Extension.pm
@@ -2044,7 +2044,10 @@ sub enter_bug_start {
# format (can be overridden with a __standard__ format)
my $cgi = Bugzilla->cgi;
if ($cgi->param('format')) {
- $cgi->delete('format') if $cgi->param('format') eq '__standard__';
+ if ($cgi->param('format') eq '__standard__') {
+ $cgi->delete('format');
+ $cgi->param('format_forced', 1);
+ }
} elsif (my $format = forced_format($cgi->param('product'))) {
$cgi->param('format', $format);
}
diff --git a/extensions/GuidedBugEntry/Extension.pm b/extensions/GuidedBugEntry/Extension.pm
index 9ff7441d3..3f739d9fe 100644
--- a/extensions/GuidedBugEntry/Extension.pm
+++ b/extensions/GuidedBugEntry/Extension.pm
@@ -43,13 +43,18 @@ sub enter_bug_start {
) {
# skip the first step if a product is provided
if ($cgi->param('product')) {
- print $cgi->redirect('enter_bug.cgi?format=guided#h=dupes' .
+ print $cgi->redirect('enter_bug.cgi?format=guided' .
+ ($cgi->param('format_forced') ? '&format_forced=1' : '') .
+ '#h=dupes' .
'|' . url_quote($cgi->param('product')) .
'|' . url_quote($cgi->param('component') || '')
);
exit;
}
+ # Do not redirect to product forms if we came from there already
+ $vars->{'format_forced'} = 1 if $cgi->param('format_forced');
+
$self->_init_vars($vars);
print $cgi->header();
$template->process('guided/guided.html.tmpl', $vars)
@@ -104,17 +109,21 @@ sub page_before_template {
my ($self, $args) = @_;
my $page = $args->{'page_id'};
my $vars = $args->{'vars'};
+ my $cgi = Bugzilla->cgi;
return unless $page eq 'guided_products.js';
- my %bug_formats;
- foreach my $product (keys %create_bug_formats) {
- if (my $format = Bugzilla::Extension::BMO::forced_format($product)) {
- $bug_formats{$product} = $format;
+ if (!$cgi->param('format_forced')) {
+ 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;
}
- $vars->{'create_bug_formats'} = \%bug_formats;
- $vars->{'webdev'} = Bugzilla->cgi->param('webdev');
+
+ $vars->{'webdev'} = $cgi->param('webdev');
}
__PACKAGE__->NAME;
diff --git a/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl b/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl
index 007ae5ce7..ee1ba2931 100644
--- a/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl
+++ b/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl
@@ -71,7 +71,7 @@ dupes.setLabels(
}
);
</script>
-<script type="text/javascript" src="page.cgi?id=guided_products.js"></script>
+<script type="text/javascript" src="page.cgi?id=guided_products.js[% "&amp;format_forced=1" IF format_forced %]"></script>
[% PROCESS global/footer.html.tmpl %]
[%############################################################################%]