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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
86d6af69
You need to sign in or sign up before continuing.
Commit
86d6af69
authored
Mar 01, 2011
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 616341: Make "tag" a valid search field in Search.pm, for the new
tagging system r=mkanat, a=mkanat (module owner)
parent
fbeb99db
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
34 deletions
+44
-34
Field.pm
Bugzilla/Field.pm
+1
-0
Search.pm
Bugzilla/Search.pm
+24
-29
field-descs.none.tmpl
template/en/default/global/field-descs.none.tmpl
+1
-0
Search.pm
xt/lib/Bugzilla/Test/Search.pm
+12
-4
Constants.pm
xt/lib/Bugzilla/Test/Search/Constants.pm
+3
-1
FieldTest.pm
xt/lib/Bugzilla/Test/Search/FieldTest.pm
+3
-0
No files found.
Bugzilla/Field.pm
View file @
86d6af69
...
...
@@ -257,6 +257,7 @@ use constant DEFAULT_FIELDS => (
{
name
=>
"owner_idle_time"
,
desc
=>
"Time Since Assignee Touched"
},
{
name
=>
'see_also'
,
desc
=>
"See Also"
,
type
=>
FIELD_TYPE_BUG_URLS
},
{
name
=>
'tag'
,
desc
=>
'Tags'
},
);
################
...
...
Bugzilla/Search.pm
View file @
86d6af69
...
...
@@ -220,6 +220,22 @@ use constant NON_NUMERIC_OPERATORS => qw(
notregexp
)
;
use
constant
MULTI_SELECT_OVERRIDE
=>
{
notequals
=>
\&
_multiselect_negative
,
notregexp
=>
\&
_multiselect_negative
,
notsubstring
=>
\&
_multiselect_negative
,
nowords
=>
\&
_multiselect_negative
,
nowordssubstr
=>
\&
_multiselect_negative
,
allwords
=>
\&
_multiselect_multiple
,
allwordssubstr
=>
\&
_multiselect_multiple
,
anyexact
=>
\&
_multiselect_multiple
,
anywords
=>
\&
_multiselect_multiple
,
anywordssubstr
=>
\&
_multiselect_multiple
,
_non_changed
=>
\&
_multiselect_nonchanged
,
};
use
constant
OPERATOR_FIELD_OVERRIDE
=>
{
# User fields
'attachments.submitter'
=>
{
...
...
@@ -281,21 +297,7 @@ use constant OPERATOR_FIELD_OVERRIDE => {
dependson
=>
{
_non_changed
=>
\&
_dependson_nonchanged
,
},
keywords
=>
{
notequals
=>
\&
_multiselect_negative
,
notregexp
=>
\&
_multiselect_negative
,
notsubstring
=>
\&
_multiselect_negative
,
nowords
=>
\&
_multiselect_negative
,
nowordssubstr
=>
\&
_multiselect_negative
,
allwords
=>
\&
_multiselect_multiple
,
allwordssubstr
=>
\&
_multiselect_multiple
,
anyexact
=>
\&
_multiselect_multiple
,
anywords
=>
\&
_multiselect_multiple
,
anywordssubstr
=>
\&
_multiselect_multiple
,
_non_changed
=>
\&
_multiselect_nonchanged
,
},
keywords
=>
MULTI_SELECT_OVERRIDE
,
'flagtypes.name'
=>
{
_default
=>
\&
_flagtypes_name
,
},
...
...
@@ -323,25 +325,13 @@ use constant OPERATOR_FIELD_OVERRIDE => {
lessthaneq
=>
\&
_owner_idle_time_greater_less
,
_default
=>
\&
_invalid_combination
,
},
product
=>
{
_non_changed
=>
\&
_product_nonchanged
,
},
tag
=>
MULTI_SELECT_OVERRIDE
,
# Custom multi-select fields
_multi_select
=>
{
notequals
=>
\&
_multiselect_negative
,
notregexp
=>
\&
_multiselect_negative
,
notsubstring
=>
\&
_multiselect_negative
,
nowords
=>
\&
_multiselect_negative
,
nowordssubstr
=>
\&
_multiselect_negative
,
allwords
=>
\&
_multiselect_multiple
,
allwordssubstr
=>
\&
_multiselect_multiple
,
anyexact
=>
\&
_multiselect_multiple
,
_non_changed
=>
\&
_multiselect_nonchanged
,
},
_multi_select
=>
MULTI_SELECT_OVERRIDE
,
# Timetracking Fields
percentage_complete
=>
{
...
...
@@ -2693,6 +2683,11 @@ sub _multiselect_table {
return
"keywords INNER JOIN keyworddefs"
.
" ON keywords.keywordid = keyworddefs.id"
;
}
elsif
(
$field
eq
'tag'
)
{
$args
->
{
full_field
}
=
'tags.name'
;
return
"bug_tag INNER JOIN tags ON bug_tag.tag_id = tags.id"
.
" AND user_id = "
.
$self
->
_user
->
id
;
}
my
$table
=
"bug_$field"
;
$args
->
{
full_field
}
=
"bug_$field.value"
;
return
$table
;
...
...
template/en/default/global/field-descs.none.tmpl
View file @
86d6af69
...
...
@@ -148,6 +148,7 @@
"settings" => "Settings",
"short_desc" => "Summary",
"status_whiteboard" => "Whiteboard",
"tags.name" => "Tags",
"target_milestone" => "Target Milestone",
"version" => "Version",
"work_time" => "Hours Worked",
...
...
xt/lib/Bugzilla/Test/Search.pm
View file @
86d6af69
...
...
@@ -429,6 +429,7 @@ sub _create_field_values {
}
$values
{
$field
}
=
$value
;
}
$values
{
'tag'
}
=
[
"$number-tag-"
.
random
()];
my
@date_fields
=
grep
{
$_
->
type
==
FIELD_TYPE_DATETIME
}
$self
->
all_fields
;
foreach
my
$field
(
@date_fields
)
{
...
...
@@ -481,6 +482,7 @@ sub _create_field_values {
my
$name
=
$field
->
name
;
$values
{
$name
}
=
[
$values
{
$name
},
$new_value
->
name
];
}
push
(
@
{
$values
{
'tag'
}
},
"6-tag-"
.
random
());
}
# On bug 5, any field that *can* be left empty, *is* left empty.
...
...
@@ -607,7 +609,7 @@ sub _create_one_bug {
# There are some things in bug_create_values that shouldn't go into
# create().
delete
@params
{
qw(attachment set_flags)
};
delete
@params
{
qw(attachment set_flags
tag
)
};
my
(
$status
,
$resolution
,
$see_also
)
=
delete
@params
{
qw(bug_status resolution see_also)
};
...
...
@@ -662,6 +664,15 @@ sub _create_one_bug {
undef
,
$bug
->
id
,
$see_also
,
'Bugzilla::BugUrl::Bugzilla'
);
$extra_values
->
{
see_also
}
=
$bug
->
see_also
;
# All the tags must be created as the admin user, so that the
# admin user can find them, later.
my
$original_user
=
Bugzilla
->
user
;
Bugzilla
->
set_user
(
$self
->
admin
);
my
$tags
=
$self
->
bug_create_value
(
$number
,
'tag'
);
$bug
->
add_tag
(
$_
)
foreach
@$tags
;
$extra_values
->
{
tags
}
=
$tags
;
Bugzilla
->
set_user
(
$original_user
);
if
(
$number
==
1
)
{
# Bug 1 needs to start off with reporter_accessible and
# cclist_accessible being 0, so that when we change them to 1,
...
...
@@ -669,12 +680,9 @@ sub _create_one_bug {
$dbh
->
do
(
'UPDATE bugs SET reporter_accessible = 0,
cclist_accessible = 0 WHERE bug_id = ?'
,
undef
,
$bug
->
id
);
}
# Bug 1 gets three comments, so that longdescs.count matches it
# uniquely. The third comment is added in the middle, so that the
# last comment contains all of the important data, like work_time.
if
(
$number
==
1
)
{
$bug
->
add_comment
(
"1-comment-"
.
random
(
100
));
}
...
...
xt/lib/Bugzilla/Test/Search/Constants.pm
View file @
86d6af69
...
...
@@ -260,7 +260,7 @@ use constant GREATERTHAN_BROKEN => (
#
# allwordssubstr on longdescs fields matches against a single comment,
# instead of matching against all comments on a bug. Same is true
# for cc
, keywords,
and bug_group.
# for cc and bug_group.
use
constant
ALLWORDS_BROKEN
=>
(
bug_group
=>
{
contains
=>
[
1
]
},
cc
=>
{
contains
=>
[
1
]
},
...
...
@@ -710,6 +710,7 @@ use constant GREATERTHAN_OVERRIDE => (
rep_platform
=>
{
contains
=>
[
2
,
3
,
4
,
5
]
},
short_desc
=>
{
contains
=>
[
2
,
3
,
4
,
5
]
},
version
=>
{
contains
=>
[
2
,
3
,
4
,
5
]
},
tag
=>
{
contains
=>
[
1
,
2
,
3
,
4
]
},
target_milestone
=>
{
contains
=>
[
2
,
3
,
4
,
5
]
},
# Bug 2 is the only bug besides 1 that has a Requestee set.
'requestees.login_name'
=>
{
contains
=>
[
2
]
},
...
...
@@ -757,6 +758,7 @@ use constant CHANGED_OVERRIDE => (
'attachments.submitter'
=>
{
contains
=>
[]
},
bug_id
=>
{
contains
=>
[]
},
reporter
=>
{
contains
=>
[]
},
tag
=>
{
contains
=>
[]
},
);
#########
...
...
xt/lib/Bugzilla/Test/Search/FieldTest.pm
View file @
86d6af69
...
...
@@ -350,6 +350,9 @@ sub _field_values_for_bug {
elsif
(
$field
eq
'see_also'
)
{
@values
=
$self
->
_values_for
(
$number
,
'see_also'
,
'name'
);
}
elsif
(
$field
eq
'tag'
)
{
@values
=
$self
->
_values_for
(
$number
,
'tags'
);
}
# Bugzilla::Bug truncates creation_ts, but we need the full value
# from the database. This has no special value for changedfrom,
# because it never changes.
...
...
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