summaryrefslogtreecommitdiffstats
path: root/query.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2007-09-23 04:28:59 +0200
committerlpsolit%gmail.com <>2007-09-23 04:28:59 +0200
commit2eec37a62c7f6916dd02ed1b27111cac53bb4e59 (patch)
treee46859c18c59f3c452b25befe382cf8c447c9a05 /query.cgi
parent3dd93a04e5eb64e5a3ae2e23ed76c191dd55bc2c (diff)
downloadbugzilla-2eec37a62c7f6916dd02ed1b27111cac53bb4e59.tar.gz
bugzilla-2eec37a62c7f6916dd02ed1b27111cac53bb4e59.tar.xz
Bug 203951: Setting your default query to include boolean charts doesn't work - Patch by Todd Stansell <tjs@tellme.com> and GavinS <bugzilla@chimpychompy.org> r=joel a=LpSolit
Diffstat (limited to 'query.cgi')
-rwxr-xr-xquery.cgi17
1 files changed, 11 insertions, 6 deletions
diff --git a/query.cgi b/query.cgi
index 5ca04d81d..c23c1b0fb 100755
--- a/query.cgi
+++ b/query.cgi
@@ -136,17 +136,22 @@ sub PrefillForm {
$default{$name} = [];
}
+ # we won't prefill the boolean chart data from this query if
+ # there are any being submitted via params
+ my $prefillcharts = (grep(/^field-/, $cgi->param)) ? 0 : 1;
# Iterate over the URL parameters
foreach my $name ($buf->param()) {
my @values = $buf->param($name);
- # If the name begins with field, type, or value, then it is part of
- # the boolean charts. Because these are built different than the rest
- # of the form, we don't need to save a default value. We do, however,
- # need to indicate that we found something so the default query isn't
- # added in if all we have are boolean chart items.
- if ($name =~ m/^(?:field|type|value)/) {
+ # If the name begins with the string 'field', 'type', 'value', or
+ # 'negate', then it is part of the boolean charts. Because
+ # these are built different than the rest of the form, we need
+ # to store these as parameters. We also need to indicate that
+ # we found something so the default query isn't added in if
+ # all we have are boolean chart items.
+ if ($name =~ m/^(?:field|type|value|negate)/) {
+ $cgi->param(-name => $name, -value => $values[0]) if ($prefillcharts);
$foundone = 1;
}
# If the name ends in a number (which it does for the fields which