]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 825975 - Move the buglist.cgi "get_format" call after processing runnamed review/8543807/v5
authorAlbert Ting <altlist@gmail.com>
Thu, 8 Jan 2015 17:39:21 +0000 (12:39 -0500)
committerDylan William Hardison <dylan@hardison.net>
Thu, 8 Jan 2015 17:39:59 +0000 (12:39 -0500)
buglist.cgi

index daee34c9bc6d2e9a5f7f23c45821e6f07ea03f67..b03cc9481804b23e3c8867f6abbe17677502c3d8 100755 (executable)
@@ -88,29 +88,6 @@ if (defined $cgi->param('ctype') && $cgi->param('ctype') eq "rss") {
     $cgi->param('ctype', "atom");
 }
 
-# Determine the format in which the user would like to receive the output.
-# Uses the default format if the user did not specify an output format;
-# otherwise validates the user's choice against the list of available formats.
-my $format = $template->get_format("list/list", scalar $cgi->param('format'),
-                                   scalar $cgi->param('ctype'));
-
-# Use server push to display a "Please wait..." message for the user while
-# executing their query if their browser supports it and they are viewing
-# the bug list as HTML and they have not disabled it by adding &serverpush=0
-# to the URL.
-#
-# Server push is compatible with Gecko-based browsers and Opera, but not with
-# MSIE, Lynx or Safari (bug 441496).
-
-my $serverpush =
-  $format->{'extension'} eq "html"
-    && exists $ENV{'HTTP_USER_AGENT'} 
-      && $ENV{'HTTP_USER_AGENT'} =~ /(Mozilla.[3-9]|Opera)/
-        && $ENV{'HTTP_USER_AGENT'} !~ /compatible/i
-          && $ENV{'HTTP_USER_AGENT'} !~ /(?:WebKit|Trident|KHTML)/
-            && !defined($cgi->param('serverpush'))
-              || $cgi->param('serverpush');
-
 my $order = $cgi->param('order') || "";
 
 # The params object to use for the actual query itself
@@ -334,16 +311,6 @@ if ($cmdtype eq "runnamed") {
 # This will be modified, so make a copy.
 $params ||= new Bugzilla::CGI($cgi);
 
-# Generate a reasonable filename for the user agent to suggest to the user
-# when the user saves the bug list.  Uses the name of the remembered query
-# if available.  We have to do this now, even though we return HTTP headers 
-# at the end, because the fact that there is a remembered query gets 
-# forgotten in the process of retrieving it.
-my $disp_prefix = "bugs";
-if ($cmdtype eq "dorem" && $remaction =~ /^run/) {
-    $disp_prefix = $cgi->param('namedcmd');
-}
-
 # Take appropriate action based on user's request.
 if ($cmdtype eq "dorem") {  
     if ($remaction eq "run") {
@@ -477,6 +444,40 @@ if (!$params->param('query_format')) {
     $buffer = $params->query_string;
 }
 
+# Determine the format in which the user would like to receive the output.
+# Uses the default format if the user did not specify an output format;
+# otherwise validates the user's choice against the list of available formats.
+my $format = $template->get_format("list/list", scalar $cgi->param('format'),
+                                   scalar $cgi->param('ctype'));
+
+# Use server push to display a "Please wait..." message for the user while
+# executing their query if their browser supports it and they are viewing
+# the bug list as HTML and they have not disabled it by adding &serverpush=0
+# to the URL.
+#
+# Server push is compatible with Gecko-based browsers and Opera, but not with
+# MSIE, Lynx or Safari (bug 441496).
+
+my $serverpush =
+  $format->{'extension'} eq "html"
+    && exists $ENV{'HTTP_USER_AGENT'} 
+      && $ENV{'HTTP_USER_AGENT'} =~ /(Mozilla.[3-9]|Opera)/
+        && $ENV{'HTTP_USER_AGENT'} !~ /compatible/i
+          && $ENV{'HTTP_USER_AGENT'} !~ /(?:WebKit|Trident|KHTML)/
+            && !defined($cgi->param('serverpush'))
+              || $cgi->param('serverpush');
+
+
+# Generate a reasonable filename for the user agent to suggest to the user
+# when the user saves the bug list.  Uses the name of the remembered query
+# if available.  We have to do this now, even though we return HTTP headers 
+# at the end, because the fact that there is a remembered query gets 
+# forgotten in the process of retrieving it.
+my $disp_prefix = "bugs";
+if ($cmdtype eq "dorem" && $remaction =~ /^run/) {
+    $disp_prefix = $cgi->param('namedcmd');
+}
+
 ################################################################################
 # Column Definition
 ################################################################################