summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormyk%mozilla.org <>2001-09-15 16:26:21 +0200
committermyk%mozilla.org <>2001-09-15 16:26:21 +0200
commit3f57a81fea0cad7497da58b7f0c1068cdcdc7c0f (patch)
tree18b1b4e41286003c426f4420687130eaeb39e24e
parent247a503301908fec8c6f4fb7c2e8038809710892 (diff)
downloadbugzilla-3f57a81fea0cad7497da58b7f0c1068cdcdc7c0f.tar.gz
bugzilla-3f57a81fea0cad7497da58b7f0c1068cdcdc7c0f.tar.xz
Fix for bug 97877: changed* operators now work for attachment statuses on query form.
Fix by Myk Melez <myk@mozilla.org> r=jake@acutex.net
-rwxr-xr-xbuglist.cgi14
1 files changed, 10 insertions, 4 deletions
diff --git a/buglist.cgi b/buglist.cgi
index f6143abaa..56c2d25a7 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -416,7 +416,7 @@ sub GenerateSQL {
$f = "$table.$field";
},
# 2001-05-16 myk@mozilla.org: enable querying against attachment status
- # if this installation has enabled use of the attachment manager.
+ # if this installation has enabled use of the attachment tracker.
"^attachstatusdefs.name," => sub {
my $attachtable = "attachments_$chartid";
my $statustable = "attachstatuses_$chartid";
@@ -427,9 +427,15 @@ sub GenerateSQL {
push(@wherepart, "bugs.bug_id = $attachtable.bug_id");
push(@wherepart, "$attachtable.attach_id = $statustable.attach_id");
push(@wherepart, "$statustable.statusid = $statusdefstable.id");
- my $table = $statusdefstable;
- my $field = "name";
- $f = "$table.$field";
+
+ # When the operator is changedbefore, changedafter, changedto,
+ # or changedby, $f appears in the query as "fielddefs.name = '$f'",
+ # so it must be the exact name of the table/field as they appear
+ # in the fielddefs table (i.e. attachstatusdefs.name). For all
+ # other operators, $f appears in the query as "$f = value", so it
+ # should be the name of the table/field with the correct table
+ # alias for this chart entry (f.e. attachstatusdefs_0.name).
+ $f = ($t =~ /^changed/) ? "attachstatusdefs.name" : "$statusdefstable.name";
},
"^changedin," => sub {
$f = "(to_days(now()) - to_days(bugs.delta_ts))";