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
46761257
Commit
46761257
authored
Nov 11, 2002
by
bugreport%peshkin.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 179260 Unknown table 'map_assigned_to' in order clause at globals.pl line 242
r=bbatez a=myk
parent
2fbc684f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
15 deletions
+21
-15
buglist.cgi
buglist.cgi
+21
-15
No files found.
buglist.cgi
View file @
46761257
...
...
@@ -495,12 +495,6 @@ my @selectnames = map($columns->{$_}->{'name'}, @selectcolumns);
# (or a removed *_time column due to permissions)
@selectnames
=
grep
(
$_
ne
''
,
@selectnames
);
# Generate the basic SQL query that will be used to generate the bug list.
my
$search
=
new
Bugzilla::
Search
(
'fields'
=>
\
@selectnames
,
'params'
=>
$params
);
my
$query
=
$search
->
getSQL
();
################################################################################
# Sort Order Determination
################################################################################
...
...
@@ -511,8 +505,8 @@ if ($::COOKIE{'LASTORDER'} && (!$order || $order =~ /^reuse/i)) {
$order_from_cookie
=
1
;
}
my
$db_order
=
""
;
# Modified version of $order for use with SQL query
if
(
$order
)
{
my
$db_order
;
# Modified version of $order for use with SQL query
# Convert the value of the "order" form field into a list of columns
# by which to sort the results.
...
...
@@ -534,6 +528,12 @@ if ($order) {
else
{
ThrowCodeError
(
"invalid_column_name_form"
);
}
}
elsif
(
!
grep
(
$fragment
=~
/^\Q$_\E(\s+(asc|desc))?$/
,
@selectnames
))
{
# Add order columns to selectnames
# The fragment has already been validated
$fragment
=~
s/\s+(asc|desc)$//
;
trick_taint
(
$fragment
);
push
@selectnames
,
$fragment
;
}
}
# Now that we have checked that all columns in the order are valid,
...
...
@@ -563,13 +563,6 @@ if ($order) {
$db_order
=
$order
;
# Copy $order into $db_order for use with SQL query
# Extra special disgusting hack: if we are ordering by target_milestone,
# change it to order by the sortkey of the target_milestone first.
if
(
$db_order
=~
/bugs.target_milestone/
)
{
$db_order
=~
s/bugs.target_milestone/ms_order.sortkey,ms_order.value/
;
$query
=~
s/\sWHERE\s/ LEFT JOIN milestones ms_order ON ms_order.value = bugs.target_milestone AND ms_order.product_id = bugs.product_id WHERE /
;
}
# If we are sorting by votes, sort in descending order if no explicit
# sort order was given
$db_order
=~
s/bugs.votes\s*(,|$)/bugs.votes desc$1/i
;
...
...
@@ -583,9 +576,22 @@ if ($order) {
$aggregate_search
=
quotemeta
(
$columns
->
{
'percentage_complete'
}
->
{
'name'
});
$db_order
=~
s/$aggregate_search/percentage_complete/g
;
$query
.=
" ORDER BY $db_order "
;
}
# Generate the basic SQL query that will be used to generate the bug list.
my
$search
=
new
Bugzilla::
Search
(
'fields'
=>
\
@selectnames
,
'params'
=>
$params
);
my
$query
=
$search
->
getSQL
();
# Extra special disgusting hack: if we are ordering by target_milestone,
# change it to order by the sortkey of the target_milestone first.
if
(
$db_order
=~
/bugs.target_milestone/
)
{
$db_order
=~
s/bugs.target_milestone/ms_order.sortkey,ms_order.value/
;
$query
=~
s/\sWHERE\s/ LEFT JOIN milestones ms_order ON ms_order.value = bugs.target_milestone AND ms_order.product_id = bugs.product_id WHERE /
;
}
$query
.=
" ORDER BY $db_order "
if
(
$order
);
################################################################################
# Query Execution
...
...
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