]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
160476 - boolean chart addition doesn't keep query template format. Patch by gerv...
authorgerv%gerv.net <>
Fri, 20 Sep 2002 04:05:14 +0000 (04:05 +0000)
committergerv%gerv.net <>
Fri, 20 Sep 2002 04:05:14 +0000 (04:05 +0000)
query.cgi
template/en/default/search/search-advanced.html.tmpl
template/en/default/search/search.html.tmpl

index 89c63073bd26f72ee5458a66c8a226b31273165d..e038d98ae263f7b59df1d5c0670190e7ed29efbf 100755 (executable)
--- a/query.cgi
+++ b/query.cgi
@@ -362,8 +362,15 @@ $default{'querytype'} = $deforder || 'Importance';
 # Add in the defaults.
 $vars->{'default'} = \%default;
 
+$vars->{'format'} = $::FORM{'format'};
+
 # Generate and return the UI (HTML page) from the appropriate template.
-my $format = GetFormat("search/search", $::FORM{'format'}, $::FORM{'ctype'});
+# If we submit back to ourselves (for e.g. boolean charts), we need to
+# preserve format information; hence query_format taking priority over
+# format.
+my $format = GetFormat("search/search", 
+                       $::FORM{'query_format'} || $::FORM{'format'}, 
+                       $::FORM{'ctype'});
 print "Content-Type: $format->{'ctype'}\n\n";
 $template->process($format->{'template'}, $vars)
   || ThrowTemplateError($template->error());
index 09e83add8b43f1b215e0964f37c869e76aeacfa5..d1614ae3a6c1e08c420c527b13a8221062589968 100644 (file)
@@ -33,7 +33,9 @@
 [% button_name = "Search" %]
 
 <form method="get" action="buglist.cgi" name="queryform">
-
+  [%# If we resubmit to ourselves, we need to know if we are using a format. %]
+  <input type="hidden" name="query_format" value="[% format %]">
+  
 [% PROCESS search/form.html.tmpl %]
 
 [% PROCESS search/knob.html.tmpl %]
index 09e83add8b43f1b215e0964f37c869e76aeacfa5..d1614ae3a6c1e08c420c527b13a8221062589968 100644 (file)
@@ -33,7 +33,9 @@
 [% button_name = "Search" %]
 
 <form method="get" action="buglist.cgi" name="queryform">
-
+  [%# If we resubmit to ourselves, we need to know if we are using a format. %]
+  <input type="hidden" name="query_format" value="[% format %]">
+  
 [% PROCESS search/form.html.tmpl %]
 
 [% PROCESS search/knob.html.tmpl %]