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
9a93c623
You need to sign in or sign up before continuing.
Commit
9a93c623
authored
Oct 02, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 600496: Make searching on [Bug creation] work again, by implementing
creation_ts for the changedafter and changedbefore operators in Search.pm. r=mkanat, a=mkanat (module owner)
parent
20409300
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
22 deletions
+17
-22
Search.pm
Bugzilla/Search.pm
+13
-14
Constants.pm
xt/lib/Bugzilla/Test/Search/Constants.pm
+4
-8
No files found.
Bugzilla/Search.pm
View file @
9a93c623
...
@@ -1264,7 +1264,7 @@ sub _special_parse_bug_status {
...
@@ -1264,7 +1264,7 @@ sub _special_parse_bug_status {
@bug_status
=
_valid_values
(
\
@bug_status
,
$legal_statuses
);
@bug_status
=
_valid_values
(
\
@bug_status
,
$legal_statuses
);
# If the user has selected every status, change to selecting none.
# If the user has selected every status, change to selecting none.
# This is functionally equivalent, but quite a lot faster.
# This is functionally equivalent, but quite a lot faster.
if
(
$all
or
scalar
(
@bug_status
)
==
scalar
(
@$legal_statuses
))
{
if
(
$all
or
scalar
(
@bug_status
)
==
scalar
(
@$legal_statuses
))
{
delete
$params
->
{
'bug_status'
};
delete
$params
->
{
'bug_status'
};
}
}
...
@@ -1285,6 +1285,8 @@ sub _special_parse_chfield {
...
@@ -1285,6 +1285,8 @@ sub _special_parse_chfield {
my
$value_to
=
$params
->
{
'chfieldvalue'
};
my
$value_to
=
$params
->
{
'chfieldvalue'
};
$value_to
=
''
if
!
defined
$value_to
;
$value_to
=
''
if
!
defined
$value_to
;
@fields
=
map
{
$_
eq
'[Bug creation]'
?
'creation_ts'
:
$_
}
@fields
;
my
@charts
;
my
@charts
;
# It is always safe and useful to push delta_ts into the charts
# It is always safe and useful to push delta_ts into the charts
# if there are any dates specified. It doesn't conflict with
# if there are any dates specified. It doesn't conflict with
...
@@ -1297,15 +1299,6 @@ sub _special_parse_chfield {
...
@@ -1297,15 +1299,6 @@ sub _special_parse_chfield {
if
(
$date_to
ne
''
)
{
if
(
$date_to
ne
''
)
{
push
(
@charts
,
[
'delta_ts'
,
'lessthaneq'
,
$date_to
]);
push
(
@charts
,
[
'delta_ts'
,
'lessthaneq'
,
$date_to
]);
}
}
if
(
grep
{
$_
eq
'[Bug creation]'
}
@fields
)
{
if
(
$date_from
ne
''
)
{
push
(
@charts
,
[
'creation_ts'
,
'greaterthaneq'
,
$date_from
]);
}
if
(
$date_to
ne
''
)
{
push
(
@charts
,
[
'creation_ts'
,
'lessthaneq'
,
$date_to
]);
}
}
# Basically, we construct the chart like:
# Basically, we construct the chart like:
#
#
...
@@ -1321,7 +1314,6 @@ sub _special_parse_chfield {
...
@@ -1321,7 +1314,6 @@ sub _special_parse_chfield {
if
(
$value_to
ne
''
)
{
if
(
$value_to
ne
''
)
{
my
@value_chart
;
my
@value_chart
;
foreach
my
$field
(
@fields
)
{
foreach
my
$field
(
@fields
)
{
next
if
$field
eq
'[Bug creation]'
;
push
(
@value_chart
,
$field
,
'changedto'
,
$value_to
);
push
(
@value_chart
,
$field
,
'changedto'
,
$value_to
);
}
}
push
(
@charts
,
\
@value_chart
)
if
@value_chart
;
push
(
@charts
,
\
@value_chart
)
if
@value_chart
;
...
@@ -1330,7 +1322,6 @@ sub _special_parse_chfield {
...
@@ -1330,7 +1322,6 @@ sub _special_parse_chfield {
if
(
$date_from
ne
''
)
{
if
(
$date_from
ne
''
)
{
my
@date_from_chart
;
my
@date_from_chart
;
foreach
my
$field
(
@fields
)
{
foreach
my
$field
(
@fields
)
{
next
if
$field
eq
'[Bug creation]'
;
push
(
@date_from_chart
,
$field
,
'changedafter'
,
$date_from
);
push
(
@date_from_chart
,
$field
,
'changedafter'
,
$date_from
);
}
}
push
(
@charts
,
\
@date_from_chart
)
if
@date_from_chart
;
push
(
@charts
,
\
@date_from_chart
)
if
@date_from_chart
;
...
@@ -2775,10 +2766,18 @@ sub _changedbefore_changedafter {
...
@@ -2775,10 +2766,18 @@ sub _changedbefore_changedafter {
my
(
$chart_id
,
$joins
,
$field
,
$operator
,
$value
)
=
my
(
$chart_id
,
$joins
,
$field
,
$operator
,
$value
)
=
@$args
{
qw(chart_id joins field operator value)
};
@$args
{
qw(chart_id joins field operator value)
};
my
$dbh
=
Bugzilla
->
dbh
;
my
$dbh
=
Bugzilla
->
dbh
;
my
$sql_operator
=
(
$operator
=~
/before/
)
?
'<='
:
'>='
;
my
$field_object
=
$self
->
_chart_fields
->
{
$field
}
my
$field_object
=
$self
->
_chart_fields
->
{
$field
}
||
ThrowCodeError
(
"invalid_field_name"
,
{
field
=>
$field
});
||
ThrowCodeError
(
"invalid_field_name"
,
{
field
=>
$field
});
# Asking when creation_ts changed is just asking when the bug was created.
if
(
$field_object
->
name
eq
'creation_ts'
)
{
$args
->
{
operator
}
=
$operator
eq
'changedbefore'
?
'lessthaneq'
:
'greaterthaneq'
;
return
$self
->
_do_operator_function
(
$args
);
}
my
$sql_operator
=
(
$operator
=~
/before/
)
?
'<='
:
'>='
;
my
$field_id
=
$field_object
->
id
;
my
$field_id
=
$field_object
->
id
;
# Charts on changed* fields need to be field-specific. Otherwise,
# Charts on changed* fields need to be field-specific. Otherwise,
# OR chart rows make no sense if they contain multiple fields.
# OR chart rows make no sense if they contain multiple fields.
...
...
xt/lib/Bugzilla/Test/Search/Constants.pm
View file @
9a93c623
...
@@ -420,13 +420,11 @@ use constant KNOWN_BROKEN => {
...
@@ -420,13 +420,11 @@ use constant KNOWN_BROKEN => {
'changedbefore'
=>
{
'changedbefore'
=>
{
CHANGED_BROKEN
,
CHANGED_BROKEN
,
'attach_data.thedata'
=>
{
contains
=>
[
1
]
},
'attach_data.thedata'
=>
{
contains
=>
[
1
]
},
creation_ts
=>
{
contains
=>
[
1
,
2
,
5
]
},
},
},
'changedafter'
=>
{
'changedafter'
=>
{
'attach_data.thedata'
=>
{
contains
=>
[
2
,
3
,
4
]
},
'attach_data.thedata'
=>
{
contains
=>
[
2
,
3
,
4
]
},
classification
=>
{
contains
=>
[
2
,
3
,
4
]
},
classification
=>
{
contains
=>
[
2
,
3
,
4
]
},
commenter
=>
{
contains
=>
[
2
,
3
,
4
]
},
commenter
=>
{
contains
=>
[
2
,
3
,
4
]
},
creation_ts
=>
{
contains
=>
[
2
,
3
,
4
]
},
delta_ts
=>
{
contains
=>
[
2
,
3
,
4
]
},
delta_ts
=>
{
contains
=>
[
2
,
3
,
4
]
},
percentage_complete
=>
{
contains
=>
[
2
,
3
,
4
]
},
percentage_complete
=>
{
contains
=>
[
2
,
3
,
4
]
},
'requestees.login_name'
=>
{
contains
=>
[
2
,
3
,
4
]
},
'requestees.login_name'
=>
{
contains
=>
[
2
,
3
,
4
]
},
...
@@ -642,7 +640,6 @@ use constant BROKEN_NOT => {
...
@@ -642,7 +640,6 @@ use constant BROKEN_NOT => {
"attach_data.thedata"
=>
{
contains
=>
[
2
,
3
,
4
]
},
"attach_data.thedata"
=>
{
contains
=>
[
2
,
3
,
4
]
},
"classification"
=>
{
contains
=>
[
2
,
3
,
4
]
},
"classification"
=>
{
contains
=>
[
2
,
3
,
4
]
},
"commenter"
=>
{
contains
=>
[
2
,
3
,
4
]
},
"commenter"
=>
{
contains
=>
[
2
,
3
,
4
]
},
"creation_ts"
=>
{
contains
=>
[
2
,
3
,
4
]
},
"delta_ts"
=>
{
contains
=>
[
2
,
3
,
4
]
},
"delta_ts"
=>
{
contains
=>
[
2
,
3
,
4
]
},
"percentage_complete"
=>
{
contains
=>
[
2
,
3
,
4
]
},
"percentage_complete"
=>
{
contains
=>
[
2
,
3
,
4
]
},
"requestees.login_name"
=>
{
contains
=>
[
2
,
3
,
4
]
},
"requestees.login_name"
=>
{
contains
=>
[
2
,
3
,
4
]
},
...
@@ -650,7 +647,6 @@ use constant BROKEN_NOT => {
...
@@ -650,7 +647,6 @@ use constant BROKEN_NOT => {
},
},
changedbefore
=>
{
changedbefore
=>
{
CHANGED_BROKEN_NOT
,
CHANGED_BROKEN_NOT
,
creation_ts
=>
{
contains
=>
[
1
,
2
,
5
]
},
work_time
=>
{
}
work_time
=>
{
}
},
},
changedby
=>
{
changedby
=>
{
...
@@ -1096,7 +1092,7 @@ use constant TESTS => {
...
@@ -1096,7 +1092,7 @@ use constant TESTS => {
{
contains
=>
[
1
],
value
=>
'<1-delta>'
,
{
contains
=>
[
1
],
value
=>
'<1-delta>'
,
override
=>
{
override
=>
{
CHANGED_OVERRIDE
,
CHANGED_OVERRIDE
,
creation_ts
=>
{
contains
=>
[
1
,
2
,
5
]
},
creation_ts
=>
{
contains
=>
[
1
,
5
]
},
blocked
=>
{
contains
=>
[
1
,
2
]
},
blocked
=>
{
contains
=>
[
1
,
2
]
},
dependson
=>
{
contains
=>
[
1
,
3
]
},
dependson
=>
{
contains
=>
[
1
,
3
]
},
longdesc
=>
{
contains
=>
[
1
,
5
]
},
longdesc
=>
{
contains
=>
[
1
,
5
]
},
...
@@ -1107,7 +1103,7 @@ use constant TESTS => {
...
@@ -1107,7 +1103,7 @@ use constant TESTS => {
{
contains
=>
[
2
,
3
,
4
],
value
=>
'<2-delta>'
,
{
contains
=>
[
2
,
3
,
4
],
value
=>
'<2-delta>'
,
override
=>
{
override
=>
{
CHANGED_OVERRIDE
,
CHANGED_OVERRIDE
,
creation_ts
=>
{
contains
=>
[
2
,
3
,
4
]
},
creation_ts
=>
{
contains
=>
[
3
,
4
]
},
# We only change this for one bug, and it doesn't match.
# We only change this for one bug, and it doesn't match.
'longdescs.isprivate'
=>
{
contains
=>
[]
},
'longdescs.isprivate'
=>
{
contains
=>
[]
},
# Same for everconfirmed.
# Same for everconfirmed.
...
@@ -1200,8 +1196,8 @@ use constant INJECTION_BROKEN_FIELD => {
...
@@ -1200,8 +1196,8 @@ use constant INJECTION_BROKEN_FIELD => {
# search => 1 means the Bugzilla::Search creation fails, but
# search => 1 means the Bugzilla::Search creation fails, but
# field_ok contains fields that it does actually succeed for.
# field_ok contains fields that it does actually succeed for.
use
constant
INJECTION_BROKEN_OPERATOR
=>
{
use
constant
INJECTION_BROKEN_OPERATOR
=>
{
changedafter
=>
{
search
=>
1
},
changedafter
=>
{
search
=>
1
,
field_ok
=>
[
'creation_ts'
]
},
changedbefore
=>
{
search
=>
1
},
changedbefore
=>
{
search
=>
1
,
field_ok
=>
[
'creation_ts'
]
},
changedby
=>
{
search
=>
1
},
changedby
=>
{
search
=>
1
},
};
};
...
...
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