Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
9785bd9b
You need to sign in or sign up before continuing.
Commit
9785bd9b
authored
Mar 03, 2011
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 638509 - Make all boolean charts work with all attachment fields except
for "Attachment data" r=mkanat, a=mkanat (module owner)
parent
6c94f376
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
39 deletions
+10
-39
Search.pm
Bugzilla/Search.pm
+10
-25
Constants.pm
xt/lib/Bugzilla/Test/Search/Constants.pm
+0
-14
No files found.
Bugzilla/Search.pm
View file @
9785bd9b
...
...
@@ -271,11 +271,9 @@ use constant OPERATOR_FIELD_OVERRIDE => {
_non_changed
=>
\&
_attach_data_thedata
,
},
# We check all attachment fields against this.
'attachments'
=>
{
_non_changed
=>
\&
_attachments
,
},
blocked
=>
MULTI_SELECT_OVERRIDE
,
bug_group
=>
MULTI_SELECT_OVERRIDE
,
attachments
=>
MULTI_SELECT_OVERRIDE
,
blocked
=>
MULTI_SELECT_OVERRIDE
,
bug_group
=>
MULTI_SELECT_OVERRIDE
,
classification
=>
{
_non_changed
=>
\&
_classification_nonchanged
,
},
...
...
@@ -2351,26 +2349,6 @@ sub _attach_data_thedata {
$args
->
{
full_field
}
=
"$data_table.thedata"
;
}
sub
_attachments
{
my
(
$self
,
$args
)
=
@_
;
my
(
$chart_id
,
$joins
,
$field
)
=
@$args
{
qw(chart_id joins field)
};
my
$dbh
=
Bugzilla
->
dbh
;
my
$table
=
"attachments_$chart_id"
;
my
$extra
=
$self
->
_user
->
is_insider
?
[]
:
[
"$table.isprivate = 0"
];
my
$join
=
{
table
=>
'attachments'
,
as
=>
$table
,
extra
=>
$extra
,
};
push
(
@$joins
,
$join
);
$field
=~
/^attachments\.(.+)$/
;
my
$attach_field
=
$1
;
$args
->
{
full_field
}
=
"$table.$attach_field"
;
}
sub
_join_flag_tables
{
my
(
$self
,
$args
)
=
@_
;
my
(
$joins
,
$chart_id
)
=
@$args
{
qw(joins chart_id)
};
...
...
@@ -2616,6 +2594,13 @@ sub _multiselect_table {
$args
->
{
full_field
}
=
'isprivate'
;
return
"longdescs"
;
}
elsif
(
$field
=~
/^attachments/
)
{
$args
->
{
_extra_where
}
=
" AND isprivate = 0"
if
!
$self
->
_user
->
is_insider
;
$field
=~
/^attachments\.(.+)$/
;
$args
->
{
full_field
}
=
$1
;
return
"attachments"
;
}
my
$table
=
"bug_$field"
;
$args
->
{
full_field
}
=
"bug_$field.value"
;
return
$table
;
...
...
xt/lib/Bugzilla/Test/Search/Constants.pm
View file @
9785bd9b
...
...
@@ -196,8 +196,6 @@ use constant SUBSTR_NO_FIELD_ADD => FIELD_TYPE_DATETIME, qw(
# bug_file_loc can be NULL, so it gets missed by the normal
# notequals search.
#
# attachments.* notequals doesn't find bugs that lack attachments.
#
# deadline notequals does not find bugs that lack deadlines
#
# setters notequal doesn't find bugs that fully lack flags.
...
...
@@ -205,13 +203,7 @@ use constant SUBSTR_NO_FIELD_ADD => FIELD_TYPE_DATETIME, qw(
#
# requestees.login_name doesn't find bugs that fully lack requestees.
use
constant
NEGATIVE_BROKEN
=>
(
'attachments.isobsolete'
=>
{
contains
=>
[
5
]
},
'attachments.ispatch'
=>
{
contains
=>
[
5
]
},
'attachments.isprivate'
=>
{
contains
=>
[
5
]
},
'attach_data.thedata'
=>
{
contains
=>
[
5
]
},
'attachments.description'
=>
{
contains
=>
[
5
]
},
'attachments.filename'
=>
{
contains
=>
[
5
]
},
'attachments.mimetype'
=>
{
contains
=>
[
5
]
},
bug_file_loc
=>
{
contains
=>
[
5
]
},
deadline
=>
{
contains
=>
[
5
]
},
# Custom fields are busted because they can be NULL.
...
...
@@ -413,12 +405,6 @@ use constant PG_BROKEN => {
# NOT test that is broken.
use
constant
COMMON_BROKEN_NOT
=>
(
"attach_data.thedata"
=>
{
contains
=>
[
5
]
},
"attachments.description"
=>
{
contains
=>
[
5
]
},
"attachments.filename"
=>
{
contains
=>
[
5
]
},
"attachments.isobsolete"
=>
{
contains
=>
[
5
]
},
"attachments.ispatch"
=>
{
contains
=>
[
5
]
},
"attachments.isprivate"
=>
{
contains
=>
[
5
]
},
"attachments.mimetype"
=>
{
contains
=>
[
5
]
},
"bug_file_loc"
=>
{
contains
=>
[
5
]
},
"deadline"
=>
{
contains
=>
[
5
]
},
"flagtypes.name"
=>
{
contains
=>
[
5
]
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment