From: lpsolit%gmail.com <> Date: Sun, 23 Sep 2007 02:30:29 +0000 (+0000) Subject: Bug 203951: Setting your default query to include boolean charts doesn't work - Patch... X-Git-Tag: bugzilla-3.0.3~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78fc8dab7a6b7240528e4a2ada9f9e7963c1a3f6;p=thirdparty%2Fbugzilla.git Bug 203951: Setting your default query to include boolean charts doesn't work - Patch by Todd Stansell and GavinS r=joel a=LpSolit --- diff --git a/query.cgi b/query.cgi index ce6aefc617..af75cb1688 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