diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-07-14 01:35:51 +0200 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-07-14 01:35:51 +0200 |
commit | 35bbe927071fe5a867b25314642827075f6f0f41 (patch) | |
tree | 98cf57139983d10c3647a10d8d8dc288ee4ce1db | |
parent | 9b37668c48ab7f57e046af7e31b34212f58df87f (diff) | |
download | bugzilla-35bbe927071fe5a867b25314642827075f6f0f41.tar.gz bugzilla-35bbe927071fe5a867b25314642827075f6f0f41.tar.xz |
Bug 578323: Remove the special parsing of "changedin" from Search.pm.
r=mkanat, a=mkanat (module owner)
-rw-r--r-- | Bugzilla/Search.pm | 43 |
1 files changed, 12 insertions, 31 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 97765b05a..de2984b7d 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -165,9 +165,6 @@ use constant OPERATOR_FIELD_OVERRIDE => { bug_group => { _non_changed => \&_bug_group_nonchanged, }, - changedin => { - _default => \&_changedin_days_elapsed, - }, classification => { _non_changed => \&_classification_nonchanged, }, @@ -180,7 +177,7 @@ use constant OPERATOR_FIELD_OVERRIDE => { _default => sub { ThrowUserError("search_content_without_matches"); }, }, days_elapsed => { - _default => \&_changedin_days_elapsed, + _default => \&_days_elapsed, }, dependson => { _non_changed => \&_dependson_nonchanged, @@ -269,6 +266,7 @@ use constant SPECIAL_PARSING => { # Backwards compatibility for times that we changed the names of fields. use constant FIELD_MAP => { + changedin => 'days_elapsed', long_desc => 'longdesc', }; @@ -737,6 +735,15 @@ sub _parse_basic_fields { my $params = $self->_params; my $chart_fields = $self->_chart_fields; + foreach my $old_name (keys %{ FIELD_MAP() }) { + if (defined $params->param($old_name)) { + my @value = $params->param($old_name); + $params->delete($old_name); + my $new_name = FIELD_MAP->{$old_name}; + $params->param($new_name, @value); + } + } + my @charts; foreach my $field_name (keys %$chart_fields) { # CGI params shouldn't have periods in them, so we only accept @@ -946,32 +953,6 @@ sub init { my @chfield = $params->param('chfield'); my $chvalue = trim($params->param('chfieldvalue')) || ''; - # 2003-05-20: The 'changedin' field is no longer in the UI, but we continue - # to process it because it will appear in stored queries and bookmarks. - my $changedin = trim($params->param('changedin')) || ''; - if ($changedin) { - if ($changedin !~ /^[0-9]*$/) { - ThrowUserError("illegal_changed_in_last_x_days", - { value => $changedin }); - } - - if (!$chfieldfrom - && !$chfieldto - && scalar(@chfield) == 1 - && $chfield[0] eq "[Bug creation]") - { - # Deal with the special case where the query is using changedin - # to get bugs created in the last n days by converting the value - # into its equivalent for the chfieldfrom parameter. - $chfieldfrom = "-" . ($changedin - 1) . "d"; - } - else { - # Oh boy, the general case. Who knows why the user included - # the changedin parameter, but do our best to comply. - push(@specialchart, ["changedin", "lessthan", $changedin + 1]); - } - } - if ($chfieldfrom ne '' || $chfieldto ne '') { my $sql_chfrom = $chfieldfrom ? $dbh->quote(SqlifyDate($chfieldfrom)):''; my $sql_chto = $chfieldto ? $dbh->quote(SqlifyDate($chfieldto)) :''; @@ -2183,7 +2164,7 @@ sub _setters_login_name { $args->{full_field} = "$map_table.login_name"; } -sub _changedin_days_elapsed { +sub _days_elapsed { my ($self, $args) = @_; my $dbh = Bugzilla->dbh; |