diff options
author | wicked%sci.fi <> | 2009-07-14 05:59:44 +0200 |
---|---|---|
committer | wicked%sci.fi <> | 2009-07-14 05:59:44 +0200 |
commit | a90fb5f05df1d23fd538a24a29f702d90049ffa7 (patch) | |
tree | c92cd69181862736e8fdb0e645447ebb34891998 | |
parent | 6470da7db34aa58a67dd045899f057eefff2a181 (diff) | |
download | bugzilla-a90fb5f05df1d23fd538a24a29f702d90049ffa7.tar.gz bugzilla-a90fb5f05df1d23fd538a24a29f702d90049ffa7.tar.xz |
Bug 448690: Changing columns after editing a saved search forgets edits - Patch by Teemu Mannermaa <wicked@sci.fi> r/a=LpSolit
-rwxr-xr-x | colchange.cgi | 21 | ||||
-rwxr-xr-x | query.cgi | 1 | ||||
-rw-r--r-- | template/en/default/search/knob.html.tmpl | 4 |
3 files changed, 12 insertions, 14 deletions
diff --git a/colchange.cgi b/colchange.cgi index 532bfd4b6..a521ee168 100755 --- a/colchange.cgi +++ b/colchange.cgi @@ -141,14 +141,12 @@ if (defined $cgi->param('rememberedquery')) { $params->param('columnlist', join(",", @collist)); $search->set_url($params->query_string()); $search->update(); - $vars->{'redirect_url'} = "buglist.cgi?".$cgi->param('rememberedquery'); - } - else { - my $params = new Bugzilla::CGI($cgi->param('rememberedquery')); - $params->param('columnlist', join(",", @collist)); - $vars->{'redirect_url'} = "buglist.cgi?".$params->query_string(); } + my $params = new Bugzilla::CGI($cgi->param('rememberedquery')); + $params->param('columnlist', join(",", @collist)); + $vars->{'redirect_url'} = "buglist.cgi?".$params->query_string(); + # If we're running on Microsoft IIS, using cgi->redirect discards # the Set-Cookie lines -- workaround is to use the old-fashioned @@ -168,7 +166,9 @@ if (defined $cgi->param('rememberedquery')) { exit; } -if (defined $cgi->cookie('COLUMNLIST')) { +if (defined $cgi->param('columnlist')) { + @collist = split(/[ ,]+/, $cgi->param('columnlist')); +} elsif (defined $cgi->cookie('COLUMNLIST')) { @collist = split(/ /, $cgi->cookie('COLUMNLIST')); } else { @collist = DEFAULT_COLUMN_LIST; @@ -186,13 +186,6 @@ if (defined $cgi->param('query_based_on')) { if ($search) { $vars->{'saved_search'} = $search; - $vars->{'buffer'} = "cmdtype=runnamed&namedcmd=". url_quote($search->name); - - my $params = new Bugzilla::CGI($search->url); - if ($params->param('columnlist')) { - my @collist = split(',', $params->param('columnlist')); - $vars->{'collist'} = \@collist if scalar (@collist); - } } } @@ -359,6 +359,7 @@ if ($cgi->param('format') && $cgi->param('format') =~ /^report-(table|graph)$/) } $vars->{'known_name'} = $cgi->param('known_name'); +$vars->{'columnlist'} = $cgi->param('columnlist'); # Add in the defaults. diff --git a/template/en/default/search/knob.html.tmpl b/template/en/default/search/knob.html.tmpl index d0381e1a4..17ff63a10 100644 --- a/template/en/default/search/knob.html.tmpl +++ b/template/en/default/search/knob.html.tmpl @@ -62,6 +62,10 @@ [%# The name of the existing query will be passed to buglist.cgi. %] <input type="hidden" name="query_based_on" value="[% known_name FILTER html %]"> [% END %] + [%# Preserve any custom column list that might be set. %] + [% IF columnlist %] + <input type="hidden" name="columnlist" value="[% columnlist FILTER html %]"> + [% END %] </p> <p> |