Commit f97a2e07 authored by bugreport%peshkin.net's avatar bugreport%peshkin.net

Bug 180980 Doing 2 email searches fails when searching for CC list members

Patch by bugreport@peshkin.net r=myk, a=justdave
parent 1e400dc0
...@@ -287,6 +287,7 @@ sub init { ...@@ -287,6 +287,7 @@ sub init {
} }
my $chartid; my $chartid;
my $sequence = 0;
# $type_id is used by the code that queries for attachment flags. # $type_id is used by the code that queries for attachment flags.
my $type_id = 0; my $type_id = 0;
my $f; my $f;
...@@ -312,23 +313,35 @@ sub init { ...@@ -312,23 +313,35 @@ sub init {
"^cc,(anyexact|substring)" => sub { "^cc,(anyexact|substring)" => sub {
my $list; my $list;
$list = $self->ListIDsForEmail($t, $v); $list = $self->ListIDsForEmail($t, $v);
my $chartseq;
$chartseq = $chartid;
if ($chartid eq "") {
$chartseq = "CC$sequence";
$sequence++;
}
if ($list) { if ($list) {
push(@supptables, "LEFT JOIN cc cc_$chartid ON bugs.bug_id = cc_$chartid.bug_id AND cc_$chartid.who IN($list)"); push(@supptables, "LEFT JOIN cc cc_$chartseq ON bugs.bug_id = cc_$chartseq.bug_id AND cc_$chartseq.who IN($list)");
$term = "cc_$chartid.who IS NOT NULL"; $term = "cc_$chartseq.who IS NOT NULL";
} else { } else {
push(@supptables, "LEFT JOIN cc cc_$chartid ON bugs.bug_id = cc_$chartid.bug_id"); push(@supptables, "LEFT JOIN cc cc_$chartseq ON bugs.bug_id = cc_$chartseq.bug_id");
push(@supptables, "LEFT JOIN profiles map_cc_$chartid ON cc_$chartid.who = map_cc_$chartid.userid"); push(@supptables, "LEFT JOIN profiles map_cc_$chartseq ON cc_$chartseq.who = map_cc_$chartseq.userid");
$ff = $f = "map_cc_$chartid.login_name"; $ff = $f = "map_cc_$chartseq.login_name";
my $ref = $funcsbykey{",anyexact"}; my $ref = $funcsbykey{",anyexact"};
&$ref; &$ref;
} }
}, },
"^cc," => sub { "^cc," => sub {
push(@supptables, "LEFT JOIN cc cc_$chartid ON bugs.bug_id = cc_$chartid.bug_id"); my $chartseq;
$chartseq = $chartid;
if ($chartid eq "") {
$chartseq = "CC$sequence";
$sequence++;
}
push(@supptables, "LEFT JOIN cc cc_$chartseq ON bugs.bug_id = cc_$chartseq.bug_id");
push(@supptables, "LEFT JOIN profiles map_cc_$chartid ON cc_$chartid.who = map_cc_$chartid.userid"); push(@supptables, "LEFT JOIN profiles map_cc_$chartseq ON cc_$chartseq.who = map_cc_$chartseq.userid");
$f = "map_cc_$chartid.login_name"; $f = "map_cc_$chartseq.login_name";
}, },
"^long_?desc,changedby" => sub { "^long_?desc,changedby" => sub {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment