Commit fac8f987 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 276232: "Bug Changes": selecting "bug creation" OR "status" (changed in date…

Bug 276232: "Bug Changes": selecting "bug creation" OR "status" (changed in date range) only returns "status" results - Patch by Todd Stansell <tjs@tellme.com> r=joel a=myk
parent b78fb46e
...@@ -303,6 +303,7 @@ sub init { ...@@ -303,6 +303,7 @@ sub init {
} else { } else {
my $bug_creation_clause; my $bug_creation_clause;
my @list; my @list;
my @actlist;
foreach my $f (@chfield) { foreach my $f (@chfield) {
if ($f eq "[Bug creation]") { if ($f eq "[Bug creation]") {
# Treat [Bug creation] differently because we need to look # Treat [Bug creation] differently because we need to look
...@@ -312,14 +313,15 @@ sub init { ...@@ -312,14 +313,15 @@ sub init {
push(@l, "bugs.creation_ts <= $sql_chto") if($sql_chto); push(@l, "bugs.creation_ts <= $sql_chto") if($sql_chto);
$bug_creation_clause = "(" . join(' AND ', @l) . ")"; $bug_creation_clause = "(" . join(' AND ', @l) . ")";
} else { } else {
push(@list, "\nactcheck.fieldid = " . get_field_id($f)); push(@actlist, "actcheck.fieldid = " . get_field_id($f));
} }
} }
# @list won't have any elements if the only field being searched # @actlist won't have any elements if the only field being searched
# is [Bug creation] (in which case we don't need bugs_activity). # is [Bug creation] (in which case we don't need bugs_activity).
if(@list) { if(@actlist) {
my $extra = ""; my $extra = " AND actcheck.bug_id = bugs.bug_id";
push(@list, "(actcheck.bug_when IS NOT NULL)");
if($sql_chfrom) { if($sql_chfrom) {
$extra .= " AND actcheck.bug_when >= $sql_chfrom"; $extra .= " AND actcheck.bug_when >= $sql_chfrom";
} }
...@@ -329,8 +331,8 @@ sub init { ...@@ -329,8 +331,8 @@ sub init {
if($sql_chvalue) { if($sql_chvalue) {
$extra .= " AND actcheck.added = $sql_chvalue"; $extra .= " AND actcheck.added = $sql_chvalue";
} }
push(@supptables, "INNER JOIN bugs_activity AS actcheck " . push(@supptables, "LEFT JOIN bugs_activity AS actcheck " .
"ON actcheck.bug_id = bugs.bug_id $extra"); "ON (" . join(" OR ", @actlist) . "$extra )");
} }
# Now that we're done using @list to determine if there are any # Now that we're done using @list to determine if there are any
......
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