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
a52f0b41
Commit
a52f0b41
authored
Aug 10, 2002
by
gerv%gerv.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 155584 - Opening duplicates.cgi with no frequent bugs causes SQL syntax…
Bug 155584 - Opening duplicates.cgi with no frequent bugs causes SQL syntax error. Patch by gerv; r=bbaetz.
parent
df194854
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
131 additions
and
128 deletions
+131
-128
duplicates.cgi
duplicates.cgi
+41
-39
duplicates-table.html.tmpl
template/en/default/reports/duplicates-table.html.tmpl
+90
-86
duplicates.html.tmpl
template/en/default/reports/duplicates.html.tmpl
+0
-3
No files found.
duplicates.cgi
View file @
a52f0b41
...
...
@@ -135,48 +135,50 @@ if (!tie(%before, 'AnyDBM_File', "data/duplicates/dupes$whenever",
$dobefore
=
1
;
}
# Don't add CLOSED, and don't add VERIFIED unless they are INVALID or
# WONTFIX. We want to see VERIFIED INVALID and WONTFIX because common
# "bugs" which aren't bugs end up in this state.
my
$query
=
"
SELECT bugs.bug_id, component, bug_severity, op_sys, target_milestone,
short_desc, bug_status, resolution
FROM bugs
WHERE (bug_status != 'CLOSED')
AND ((bug_status = 'VERIFIED' AND resolution IN ('INVALID', 'WONTFIX'))
OR (bug_status != 'VERIFIED'))
AND bugs.bug_id IN ("
.
join
(
", "
,
keys
%
count
)
.
")"
;
# Limit to a single product if requested
$query
.=
(
" AND product = "
.
SqlQuote
(
$product
))
if
$product
;
SendSQL
(
SelectVisible
(
$query
,
$userid
,
$usergroupset
));
my
@bugs
;
my
@bug_ids
;
while
(
MoreSQLData
())
{
# Note: maximum row count is dealt with in the template.
my
(
$id
,
$component
,
$bug_severity
,
$op_sys
,
$target_milestone
,
$short_desc
,
$bug_status
,
$resolution
)
=
FetchSQLData
();
# Limit to open bugs only if requested
next
if
$openonly
&&
(
$resolution
ne
""
);
push
(
@bugs
,
{
id
=>
$id
,
count
=>
$count
{
$id
},
delta
=>
$delta
{
$id
},
component
=>
$component
,
bug_severity
=>
$bug_severity
,
op_sys
=>
$op_sys
,
target_milestone
=>
$target_milestone
,
short_desc
=>
$short_desc
,
bug_status
=>
$bug_status
,
resolution
=>
$resolution
});
push
(
@bug_ids
,
$id
);
if
(
scalar
(
%
count
))
{
# Don't add CLOSED, and don't add VERIFIED unless they are INVALID or
# WONTFIX. We want to see VERIFIED INVALID and WONTFIX because common
# "bugs" which aren't bugs end up in this state.
my
$query
=
"
SELECT bugs.bug_id, component, bug_severity, op_sys, target_milestone,
short_desc, bug_status, resolution
FROM bugs
WHERE (bug_status != 'CLOSED')
AND ((bug_status = 'VERIFIED' AND resolution IN ('INVALID', 'WONTFIX'))
OR (bug_status != 'VERIFIED'))
AND bugs.bug_id IN ("
.
join
(
", "
,
keys
%
count
)
.
")"
;
# Limit to a single product if requested
$query
.=
(
" AND product = "
.
SqlQuote
(
$product
))
if
$product
;
SendSQL
(
SelectVisible
(
$query
,
$userid
,
$usergroupset
));
while
(
MoreSQLData
())
{
# Note: maximum row count is dealt with in the template.
my
(
$id
,
$component
,
$bug_severity
,
$op_sys
,
$target_milestone
,
$short_desc
,
$bug_status
,
$resolution
)
=
FetchSQLData
();
# Limit to open bugs only if requested
next
if
$openonly
&&
(
$resolution
ne
""
);
push
(
@bugs
,
{
id
=>
$id
,
count
=>
$count
{
$id
},
delta
=>
$delta
{
$id
},
component
=>
$component
,
bug_severity
=>
$bug_severity
,
op_sys
=>
$op_sys
,
target_milestone
=>
$target_milestone
,
short_desc
=>
$short_desc
,
bug_status
=>
$bug_status
,
resolution
=>
$resolution
});
push
(
@bug_ids
,
$id
);
}
}
$vars
->
{
'bugs'
}
=
\
@bugs
;
...
...
template/en/default/reports/duplicates-table.html.tmpl
View file @
a52f0b41
...
...
@@ -44,100 +44,104 @@
[%# *** Column Headers *** %]
<table border>
<tr bgcolor="#CCCCCC">
[% FOREACH column = [ { name => "id", description => "Bug #" },
{ name => "count", description => "Dupe<br>Count" },
{ name => "delta",
description => "Change in last<br>$changedsince day(s)" },
{ name => "component", description => "Component" },
{ name => "bug_severity", description => "Severity" },
{ name => "op_sys", description => "Op Sys" },
{ name => "target_milestone",
description => "Target<br>Milestone" },
{ name => "short_desc", description => "Summary" } ]
%]
[%# Small hack to keep delta column out if we don't need it %]
[% NEXT IF column.name == "delta" AND NOT dobefore %]
[% IF bug_ids.size > 0 %]
<table border>
<tr bgcolor="#CCCCCC">
[% FOREACH column = [ { name => "id", description => "Bug #" },
{ name => "count", description => "Dupe<br>Count" },
{ name => "delta",
description => "Change in last<br>$changedsince day(s)" },
{ name => "component", description => "Component" },
{ name => "bug_severity", description => "Severity" },
{ name => "op_sys", description => "Op Sys" },
{ name => "target_milestone",
description => "Target<br>Milestone" },
{ name => "short_desc", description => "Summary" } ]
%]
<td>
<center>
<b>
[% bug_ids_string = bug_ids.join(',') %]
<a href="duplicates.cgi?sortby=[% column.name %]
[% IF sortby == column.name %]
[% "&reverse=1" IF NOT reverse %]
[% ELSE %]
[%-# Some columns start off reversed %]
[% "&reverse=1" IF column.name.match('delta|count') %]
[% END %]
[% "&maxrows=$maxrows" IF maxrows %]
[% "&changedsince=$changedsince" IF changedsince %]
[% "&openonly=1" IF openonly %]
[% "&product=$product" IF product %]
[% "&format=$format" IF format %]
[% "&bug_id=$bug_ids_string&sortvisible=1" IF sortvisible %]">
[% column.description %]</a>
</b>
</center>
</td>
[% END %]
</tr>
[% IF NOT sortby %]
[% sortby = "count"; reverse = "1" %]
[% END %]
[%# Small hack to keep delta column out if we don't need it %]
[% NEXT IF column.name == "delta" AND NOT dobefore %]
[% IF sortby == "id" OR sortby == "count" OR sortby == "delta" %]
[%# Numeric sort %]
[% sortedbugs = bugs.nsort(sortby) %]
[% ELSE %]
[% sortedbugs = bugs.sort(sortby) %]
[% END %]
<td>
<center>
<b>
[% bug_ids_string = bug_ids.join(',') %]
<a href="duplicates.cgi?sortby=[% column.name %]
[% IF sortby == column.name %]
[% "&reverse=1" IF NOT reverse %]
[% ELSE %]
[%-# Some columns start off reversed %]
[% "&reverse=1" IF column.name.match('delta|count') %]
[% END %]
[% "&maxrows=$maxrows" IF maxrows %]
[% "&changedsince=$changedsince" IF changedsince %]
[% "&openonly=1" IF openonly %]
[% "&product=$product" IF product %]
[% "&format=$format" IF format %]
[% "&bug_id=$bug_ids_string&sortvisible=1" IF sortvisible %]">
[% column.description %]</a>
</b>
</center>
</td>
[% END %]
</tr>
[% IF reverse %]
[% bugs = sortedbugs.reverse %]
[% ELSE %]
[% bugs = sortedbugs %]
[% END %]
[% IF NOT sortby %]
[% sortby = "count"; reverse = "1" %]
[% END %]
[%# *** Buglist *** %]
[% IF sortby == "id" OR sortby == "count" OR sortby == "delta" %]
[%# Numeric sort %]
[% sortedbugs = bugs.nsort(sortby) %]
[% ELSE %]
[% sortedbugs = bugs.sort(sortby) %]
[% END %]
[%# We need to keep track of the bug IDs we are actually displaying, because
# if the user decides to sort the visible list, we need to know what that
# list actually is. %]
[% vis_bug_ids = [] %]
[% IF reverse %]
[% bugs = sortedbugs.reverse %]
[% ELSE %]
[% bugs = sortedbugs %]
[% END %]
[% FOREACH bug = bugs %]
[% LAST IF loop.index() >= maxrows %]
[% vis_bug_ids.push(bug.id) %]
[%# *** Buglist *** %]
<tr>
<td>
<center>
[% "<strike>" IF bug.resolution != "" %]
<a href="show_bug.cgi?id=[% bug.id %]">[% bug.id %]</a>
[% "</strike>" IF bug.resolution != "" %]
</center>
</td>
[%# We need to keep track of the bug IDs we are actually displaying, because
# if the user decides to sort the visible list, we need to know what that
# list actually is. %]
[% vis_bug_ids = [] %]
<td>
<center>
[% bug.count %]
</center>
</td>
[% FOREACH bug = bugs %]
[% LAST IF loop.index() >= maxrows %]
[% vis_bug_ids.push(bug.id) %]
[% IF dobefore %]
<td><center>[% bug.delta %]</center></td>
[% END %]
<tr>
<td>
<center>
[% "<strike>" IF bug.resolution != "" %]
<a href="show_bug.cgi?id=[% bug.id %]">[% bug.id %]</a>
[% "</strike>" IF bug.resolution != "" %]
</center>
</td>
<td>[% bug.component %]</td>
<td><center>[% bug.bug_severity %]</center></td>
<td><center>[% bug.op_sys %]</center></td>
<td><center>[% bug.target_milestone %]</center></td>
<td>[% bug.short_desc FILTER html %]</td>
</tr>
[% END %]
<td>
<center>
[% bug.count %]
</center>
</td>
[% IF dobefore %]
<td><center>[% bug.delta %]</center></td>
[% END %]
<td>[% bug.component %]</td>
<td><center>[% bug.bug_severity %]</center></td>
<td><center>[% bug.op_sys %]</center></td>
<td><center>[% bug.target_milestone %]</center></td>
<td>[% bug.short_desc FILTER html %]</td>
</tr>
[% END %]
</table>
</table>
[% ELSE %]
<h3>No duplicate bugs found.</h3>
[% END %]
template/en/default/reports/duplicates.html.tmpl
View file @
a52f0b41
...
...
@@ -49,9 +49,6 @@
[% PROCESS "reports/duplicates-table.html.tmpl" %]
<br>
<br>
[%# *** Parameters *** %]
[% bug_ids_string = vis_bug_ids.join(',') %]
...
...
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