From 26426fe87683c76702a2340bf852e8bb0eca7626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Buclin?= Date: Mon, 1 Feb 2010 12:46:42 -0800 Subject: =?UTF-8?q?Bug=20537746:=20Search=20criteria=20headers=20on=20bugl?= =?UTF-8?q?ist=20duplicate=20unnecessarily=20when=20bugidtype=20is=20in=20?= =?UTF-8?q?use=20Patch=20by=20Fr=C3=A9d=C3=A9ric=20Buclin=20=20r/a=3Dmkanat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/CGI.pm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'Bugzilla/CGI.pm') diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm index 8a0e2efe9..6e9dfd0ce 100644 --- a/Bugzilla/CGI.pm +++ b/Bugzilla/CGI.pm @@ -110,6 +110,7 @@ sub new { sub canonicalise_query { my ($self, @exclude) = @_; + $self->convert_old_params(); # Reconstruct the URL by concatenating the sorted param=value pairs my @parameters; foreach my $key (sort($self->param())) { @@ -134,6 +135,17 @@ sub canonicalise_query { return join("&", @parameters); } +sub convert_old_params { + my $self = shift; + + # bugidtype is now bug_id_type. + if ($self->param('bugidtype')) { + my $value = $self->param('bugidtype') eq 'exclude' ? 'nowords' : 'anyexact'; + $self->param('bug_id_type', $value); + $self->delete('bugidtype'); + } +} + sub clean_search_url { my $self = shift; # Delete any empty URL parameter. @@ -153,9 +165,6 @@ sub clean_search_url { } } - # Delete certain parameters if the associated parameter is empty. - $self->delete('bugidtype') if !$self->param('bug_id'); - # Delete leftovers from the login form $self->delete('Bugzilla_remember', 'GoAheadAndLogIn'); -- cgit v1.2.1