summaryrefslogtreecommitdiffstats
path: root/Bugzilla/FlagType.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2012-01-09 22:01:11 +0100
committerDave Lawrence <dlawrence@mozilla.com>2012-01-09 22:01:11 +0100
commitfc00589a935d888db49ca4d45675102f1affacd0 (patch)
treeda99ccc4803ccb292daf4037a8f19b92d0fd5a54 /Bugzilla/FlagType.pm
parent23df227af3c7e2d1e9aaefda9ff2b4fd45546ac3 (diff)
downloadbugzilla-fc00589a935d888db49ca4d45675102f1affacd0.tar.gz
bugzilla-fc00589a935d888db49ca4d45675102f1affacd0.tar.xz
715477: Inactive but set flags are no longer visible when editing a bug
https://bugzilla.mozilla.org/show_bug.cgi?id=715477
Diffstat (limited to 'Bugzilla/FlagType.pm')
-rw-r--r--Bugzilla/FlagType.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/Bugzilla/FlagType.pm b/Bugzilla/FlagType.pm
index ea81dfe46..b17e2771e 100644
--- a/Bugzilla/FlagType.pm
+++ b/Bugzilla/FlagType.pm
@@ -601,7 +601,7 @@ sub match {
$tables = join(' ', @$tables);
$criteria = join(' AND ', @criteria);
- my $flagtype_ids = $dbh->selectcol_arrayref("SELECT id FROM $tables WHERE $criteria");
+ my $flagtype_ids = $dbh->selectcol_arrayref("SELECT flagtypes.id FROM $tables WHERE $criteria");
return Bugzilla::FlagType->new_from_list($flagtype_ids);
}
@@ -679,6 +679,11 @@ sub sqlify_criteria {
my $is_active = $criteria->{is_active} ? "1" : "0";
push(@criteria, "flagtypes.is_active = $is_active");
}
+ if (exists($criteria->{active_or_has_flags}) && $criteria->{active_or_has_flags} =~ /^\d+$/) {
+ push(@$tables, "LEFT JOIN flags AS f ON flagtypes.id = f.type_id " .
+ "AND f.bug_id = " . $criteria->{active_or_has_flags});
+ push(@criteria, "(flagtypes.is_active = 1 OR f.id IS NOT NULL)");
+ }
if ($criteria->{product_id}) {
my $product_id = $criteria->{product_id};