summaryrefslogtreecommitdiffstats
path: root/extensions/TrackingFlags
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-10-14 22:06:37 +0200
committerByron Jones <bjones@mozilla.com>2013-10-14 22:06:37 +0200
commit3eabf868b703bda6547c2693ee45d7bc0b19ae74 (patch)
tree95f093f9c1b8ef045b6f20e18513c17ce64f23b0 /extensions/TrackingFlags
parent0e32c5241cc8d603326feff068f08106ad600e2a (diff)
downloadbugzilla-3eabf868b703bda6547c2693ee45d7bc0b19ae74.tar.gz
bugzilla-3eabf868b703bda6547c2693ee45d7bc0b19ae74.tar.xz
Bug 926272: searching for an unset tracking flag fails since BMO upgrade
Diffstat (limited to 'extensions/TrackingFlags')
-rw-r--r--extensions/TrackingFlags/Extension.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/extensions/TrackingFlags/Extension.pm b/extensions/TrackingFlags/Extension.pm
index 426ab9065..84250859c 100644
--- a/extensions/TrackingFlags/Extension.pm
+++ b/extensions/TrackingFlags/Extension.pm
@@ -402,6 +402,23 @@ sub search_operator_field_override {
}
}
+sub search_clause_structure {
+ my ($self, $args) = @_;
+ # when searching, map "eq ---" to "isempty"
+ my $clause = $args->{clause};
+ my @tracking_flags = map { $_->name } Bugzilla::Extension::TrackingFlags::Flag->get_all;
+ $clause->walk_conditions(sub {
+ my ($clause, $condition) = @_;
+ if (grep { $condition->field eq $_ } @tracking_flags
+ and $condition->{value} eq '---')
+ {
+ $condition->{operator} = $condition->{operator} =~ /^not/
+ ? 'isnotempty'
+ : 'isempty';
+ }
+ });
+}
+
sub _tracking_flags_search_nonchanged {
my ($flag_id, $search, $args) = @_;
my ($bugs_table, $chart_id, $joins, $value, $operator) =