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



Attachments & Requests
15 years ago
5 years ago


(Reporter: bbaetz, Assigned: Joel Peshkin)


Bugzilla 2.18
Dependency tree / graph
Bug Flags:
approval +


(Whiteboard: [fixed in 2.17.3])


(1 attachment, 3 obsolete attachments)



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

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.

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

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

Comment 3

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

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.


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

Comment 4

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

>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

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


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

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-

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

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

Comment 9

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

Attachment #107331 - Flags: review+

Comment 10

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

Comment 11

15 years ago
checked in
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.