summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2011-03-03 20:41:35 +0100
committerMax Kanat-Alexander <mkanat@bugzilla.org>2011-03-03 20:41:35 +0100
commitac3fc4635663e59fd953c26d66e1b0d4f7dd7764 (patch)
tree4b718716946177992e95c438cae7ee7f99f0233d /Bugzilla
parent9785bd9b3e44af9cbd4fc37b37b5eb00a94b69ee (diff)
downloadbugzilla-ac3fc4635663e59fd953c26d66e1b0d4f7dd7764.tar.gz
bugzilla-ac3fc4635663e59fd953c26d66e1b0d4f7dd7764.tar.xz
Bug 638518: Make all boolean chart operators work with attach_data.thedata
r=mkanat, a=mkanat (module owner)
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Search.pm33
1 files changed, 7 insertions, 26 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index ce4b1605e..5c12e2ad6 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -267,11 +267,9 @@ use constant OPERATOR_FIELD_OVERRIDE => {
alias => {
_non_changed => \&_alias_nonchanged,
},
- 'attach_data.thedata' => {
- _non_changed => \&_attach_data_thedata,
- },
# We check all attachment fields against this.
attachments => MULTI_SELECT_OVERRIDE,
+ 'attach_data.thedata' => MULTI_SELECT_OVERRIDE,
blocked => MULTI_SELECT_OVERRIDE,
bug_group => MULTI_SELECT_OVERRIDE,
classification => {
@@ -2326,29 +2324,6 @@ sub _percentage_complete {
$self->_add_extra_column('actual_time');
}
-sub _attach_data_thedata {
- my ($self, $args) = @_;
- my ($chart_id, $joins) = @$args{qw(chart_id joins)};
-
- my $attach_table = "attachments_$chart_id";
- my $data_table = "attachdata_$chart_id";
- my $extra = $self->_user->is_insider
- ? [] : ["$attach_table.isprivate = 0"];
- my $attachments_join = {
- table => 'attachments',
- as => $attach_table,
- extra => $extra,
- };
- my $data_join = {
- table => 'attach_data',
- as => $data_table,
- from => "$attach_table.attach_id",
- to => "id",
- };
- push(@$joins, $attachments_join, $data_join);
- $args->{full_field} = "$data_table.thedata";
-}
-
sub _join_flag_tables {
my ($self, $args) = @_;
my ($joins, $chart_id) = @$args{qw(joins chart_id)};
@@ -2601,6 +2576,12 @@ sub _multiselect_table {
$args->{full_field} = $1;
return "attachments";
}
+ elsif ($field eq 'attach_data.thedata') {
+ $args->{_extra_where} = " AND attachments.isprivate = 0"
+ if !$self->_user->is_insider;
+ return "attachments INNER JOIN attach_data "
+ . " ON attachments.attach_id = attach_data.id"
+ }
my $table = "bug_$field";
$args->{full_field} = "bug_$field.value";
return $table;