diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2011-03-02 09:39:49 +0100 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2011-03-02 09:39:49 +0100 |
commit | 7d90eaa8770c0b29567b78b89d81334211fa2482 (patch) | |
tree | 937e877fa3559d5f61922db52f1b44917e55d9d7 | |
parent | ef54a40d5d849aa6fab73ddd4f3497055ce21eb6 (diff) | |
download | bugzilla-7d90eaa8770c0b29567b78b89d81334211fa2482.tar.gz bugzilla-7d90eaa8770c0b29567b78b89d81334211fa2482.tar.xz |
Bug 617641: Using any of the _realname columns in Search.pm all by themselves
wasn't working properly.
r=mkanat, a=mkanat (module owner)
-rw-r--r-- | Bugzilla/Search.pm | 2 | ||||
-rw-r--r-- | xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 73235ded3..edb59e40e 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -945,6 +945,8 @@ sub _sql_limit { sub _column_join { my ($self, $field) = @_; + # The _realname fields require the same join as the username fields. + $field =~ s/_realname$//; my $join_info = COLUMN_JOINS->{$field}; if ($join_info) { # Don't allow callers to modify the constant. diff --git a/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm b/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm index b891c1587..1e0a75f95 100644 --- a/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm +++ b/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm @@ -58,6 +58,18 @@ sub name { return "$name (Normal Params)"; } +sub search_columns { + my $self = shift; + my $field = $self->field; + # For the assigned_to, qa_contact, and reporter fields, have the + # "Normal Params" test check that the _realname columns work + # all by themselves. + if (grep($_ eq $field, EMAIL_FIELDS) && $self->field_object->buglist) { + return ['bug_id', "${field}_realname"] + } + return $self->SUPER::search_columns(@_); +} + sub search_params { my ($self) = @_; my $field = $self->field; @@ -103,4 +115,4 @@ sub search_params { return { $field => $value, "${field}_type" => $operator }; } -1;
\ No newline at end of file +1; |