]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 617641: Using any of the _realname columns in Search.pm all by themselves
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Wed, 2 Mar 2011 08:39:49 +0000 (00:39 -0800)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Wed, 2 Mar 2011 08:39:49 +0000 (00:39 -0800)
wasn't working properly.
r=mkanat, a=mkanat (module owner)

Bugzilla/Search.pm
xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm

index 73235ded3be5e503b43f82201f1478694fd584e6..edb59e40e01aebc4fd4bcc9ccd9f01559ba3d1fb 100644 (file)
@@ -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.
index b891c1587cb4ef50a249a939663d9362ae98a9e1..1e0a75f952ea52fae5bdb4cdb9fa7b40346b8c74 100644 (file)
@@ -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;