If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

request.cgi doesn't filter list of products/components

RESOLVED FIXED in Bugzilla 2.18

Status

()

Bugzilla
Attachments & Requests
P2
critical
RESOLVED FIXED
15 years ago
5 years ago

People

(Reporter: bbaetz, Assigned: Joel Peshkin)

Tracking

2.17.1
Bugzilla 2.18
x86
Linux
Dependency tree / graph
Bug Flags:
approval +

Details

(Whiteboard: [fixed in 2.17.3])

Attachments

(1 attachment, 3 obsolete attachments)

(Reporter)

Description

15 years ago
The product list (and the subsequent components) aren't being filtered based on
buggroups.

We probably want a GetEnterableProducts thing which ignores the versioncache and
does a single db query instead - it'd be faster than iterating though the
versioncache list + a db query for each.

request.cgi has the extra 

It may be easier to wait for joel's group stuff to land for this, though, or
create the sub as part of that, and then fix requests.cgi here, or something
along those lines.
(Assignee)

Comment 1

15 years ago
OK, fair enough.

I'll include the GetEnterableProducts() in bug 147275 and we'll get this resolved.
Depends on: 147275
Priority: -- → P2
Target Milestone: --- → Bugzilla 2.18
(Reporter)

Comment 2

15 years ago
hmm. The (truncated) third paragraph was meant to talk about the extra
components fun; we may want to the grab code from query.cgi, or just do:

SELECT DISTINCT name FROM components WHERE product_id IN (whatever)

(possibly with ORDER BY) which may be more efficient anyway
Blocks: 171553
(Assignee)

Comment 3

15 years ago
Created attachment 107300 [details] [diff] [review]
patch

This actually rolls most of what normally would have come from versioncache
into a new query in globals.pl

In the future, this query could be extended to replace versioncache altogether.
(Assignee)

Updated

15 years ago
Attachment #107300 - Flags: review?(bbaetz)
(Reporter)

Comment 4

15 years ago
Comment on attachment 107300 [details] [diff] [review]
patch

>Index: globals.pl


>+sub GetEnterableProductHash {
>+    my $query = "SELECT products.name, components.name, versions.value " .
>+                "FROM products " .
>+                "LEFT JOIN components " .
>+                "ON components.product_id = products.id " .
>+                "LEFT JOIN versions " .
>+                "ON versions.product_id = products.id " .
>+                "LEFT JOIN group_control_map " .
>+                "ON group_control_map.product_id = products.id " .
>+                "AND group_control_map.entry != 0 ";
>+    if ((defined @{$::vars->{user}{groupids}}) 
>+        && (@{$::vars->{user}{groupids}} > 0)) {
>+        $query .= "AND group_id NOT IN(" . 
>+                   join(',',@{$::vars->{user}{groupids}}) . ") ";
>+    }
>+    $query .= "WHERE group_id IS NULL " .
>+              "ORDER BY products.name, components.name, versions.value";

Can't you GROUP BY products.name, components.name, versions.value, and that way
avoid the grep below (which you need in case the product has multiple entry
groups)
(Assignee)

Comment 5

15 years ago
Created attachment 107328 [details] [diff] [review]
patch v2

Removed versions table info since User.pm and Bug.pm will use a better approach
to making versiontable go away.
Attachment #107300 - Attachment is obsolete: true
(Assignee)

Updated

15 years ago
Attachment #107300 - Flags: review?(bbaetz)
(Reporter)

Comment 6

15 years ago
Comment on attachment 107328 [details] [diff] [review]
patch v2

Nedd \Q \E arroudn the grep regexps.

Just use |$_ eq $whatever| = its simpler/easier/etc
Attachment #107328 - Flags: review-
(Assignee)

Comment 7

15 years ago
Created attachment 107329 [details] [diff] [review]
patch v3

OK....	good point. This is much simpler now.
Attachment #107328 - Attachment is obsolete: true
(Assignee)

Comment 8

15 years ago
Created attachment 107331 [details] [diff] [review]
patch v4

I doubt it will get smaller than this.
Attachment #107329 - Attachment is obsolete: true
(Reporter)

Comment 9

15 years ago
Comment on attachment 107331 [details] [diff] [review]
patch v4

r=bbaetz
Attachment #107331 - Flags: review+
(Assignee)

Comment 10

15 years ago
taking assignment and requesting a=
Assignee: myk → bugreport
Flags: approval?
Flags: approval? → approval+
(Assignee)

Comment 11

15 years ago
checked in
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
Blocks: 190911
Whiteboard: [fixed in 2.17.3]
Removing security flag...  this was fixed in 2.17.3, which was out a long time ago.
Group: webtools-security
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.