From 807c816305af7ff71b4d243d747e296e6b15fd3f Mon Sep 17 00:00:00 2001 From: "bugreport%peshkin.net" <> Date: Wed, 26 May 2004 13:51:52 +0000 Subject: Bug 244650: Fix query on commentor in combination with other email-based criteria r=justdave a=justdave --- Bugzilla/Search.pm | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) (limited to 'Bugzilla/Search.pm') diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 6d3c7c916..241439cf5 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -200,22 +200,7 @@ sub init { } } if ($params->param("emaillongdesc$id")) { - if (my $list = $self->ListIDsForEmail($type, $email)) { - my $table = "longdescs_email_$id"; - push(@supptables, "LEFT JOIN longdescs $table ON bugs.bug_id = $table.bug_id AND $table.who IN($list)"); - push(@wherepart, "$table.who IS NOT NULL"); - # push something into @clist so that we don't trigger - # the missing_email_type error below - push(@clist, 'noop'); - } else { - my $table = "longdescs_email_$id"; - push(@supptables, "longdescs $table"); - push(@wherepart, "$table.bug_id = bugs.bug_id"); - my $ptable = "longdescnames_email_$id"; - push(@supptables, "profiles $ptable"); - push(@wherepart, "$table.who = $ptable.userid"); - push(@clist, "$ptable.login_name", $type, $email); - } + push(@clist, "commenter", $type, $email); } if (@clist) { push(@specialchart, \@clist); @@ -457,6 +442,31 @@ sub init { push(@fields, $select_term); } }, + "^commenter," => sub { + my $chartseq; + my $list; + $list = $self->ListIDsForEmail($t, $v); + $chartseq = $chartid; + if ($chartid eq "") { + $chartseq = "LD$sequence"; + $sequence++; + } + my $table = "longdescs_$chartseq"; + my $extra = ""; + if (Param("insidergroup") && !&::UserInGroup(Param("insidergroup"))) { + $extra = "AND $table.isprivate < 1"; + } + if ($list) { + push(@supptables, "LEFT JOIN longdescs $table ON $table.bug_id = bugs.bug_id $extra AND $table.who IN ($list)"); + $term = "$table.who IS NOT NULL"; + } else { + push(@supptables, "LEFT JOIN longdescs $table ON $table.bug_id = bugs.bug_id $extra"); + push(@supptables, "LEFT JOIN profiles map_$table ON $table.who = map_$table.userid"); + $ff = $f = "map_$table.login_name"; + my $ref = $funcsbykey{",$t"}; + &$ref; + } + }, "^long_?desc," => sub { my $table = "longdescs_$chartid"; push(@supptables, "longdescs $table"); @@ -1100,7 +1110,7 @@ sub SqlifyDate { # ListIDsForEmail returns a string with a comma-joined list # of userids matching email addresses # according to the type specified. -# Currently, this only supports anyexact and substring matches. +# Currently, this only supports exact, anyexact, and substring matches. # Substring matches will return up to 50 matching userids # If a match type is unsupported or returns too many matches, # ListIDsForEmail returns an undef. -- cgit v1.2.3-24-g4f1b