Closed Bug 330521 Opened 19 years ago Closed 19 years ago

Remove @::legal_product, @::legal_components and @::legal_target_milestone

Categories

(Bugzilla :: Bugzilla-General, enhancement)

2.23
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.0

People

(Reporter: LpSolit, Assigned: LpSolit)

References

Details

Attachments

(1 file)

There are of no use anymore.
Status: NEW → ASSIGNED
Summary: Remove @::legal_components and @::legal_target_milestone → Remove @::legal_product, @::legal_components and @::legal_target_milestone
Attached patch patch, v1 (deleted) — Splinter Review
Remove @::legal_product, @::legal_components and @::legal_target_milestone at once.
Attachment #215087 - Flags: review?(mkanat)
Comment on attachment 215087 [details] [diff] [review] patch, v1 >+ my @products = Bugzilla::Product::get_all_products(); >+ # We require all unique component names. >+ my %components; >+ foreach my $product (@products) { >+ foreach my $component (@{$product->components}) { >+ $components{$component->name} = 1; >+ } >+ } >+ $vars->{'products'} = \@products; >+ $vars->{'components'} = [sort(keys %components)]; Instead of this, just create Bugzilla::Product::distinct_names. It's a single SELECT DISTINCT function, and it looks like we need it fairly frequently. Yeah, in fact, almost this entire patch could be re-written to use distinct_names functions. They're a lot less code in the callers than what you're doing.
Attachment #215087 - Flags: review?(mkanat) → review-
mkanat, the reason I'm against Bugzilla::Product::distinct_names is that we need to have components per product, which requires product objects, and AFAIK, that's the only place where we want all component names. In *all* other cases, we have to list them based on user privs, and that's the job of get_selectable_products() and get_enterable_products(), as I did in query.cgi. Even if you use distinct_names(), you still have to use product objects to know which ones can be displayed, so this function doesn't fix anything.
Comment on attachment 215087 [details] [diff] [review] patch, v1 Okay, after talking about things with LpSolit in IRC, he points out that we have to use get_selectable_products in most places anyhow, so having distinct_names functions wouldn't be useful. Right now editflagtypes.cgi just needs to be cleaned up, so that's why we have what we have, there. r=mkanat by inspection LpSolit says he's tested it, and I trust his testing.
Attachment #215087 - Flags: review- → review+
Severity: trivial → enhancement
Flags: approval?
Flags: approval? → approval+
Checking in collectstats.pl; /cvsroot/mozilla/webtools/bugzilla/collectstats.pl,v <-- collectstats.pl new revision: 1.47; previous revision: 1.46 done Checking in config.cgi; /cvsroot/mozilla/webtools/bugzilla/config.cgi,v <-- config.cgi new revision: 1.18; previous revision: 1.17 done Checking in editflagtypes.cgi; /cvsroot/mozilla/webtools/bugzilla/editflagtypes.cgi,v <-- editflagtypes.cgi new revision: 1.33; previous revision: 1.32 done Checking in globals.pl; /cvsroot/mozilla/webtools/bugzilla/globals.pl,v <-- globals.pl new revision: 1.360; previous revision: 1.359 done Checking in post_bug.cgi; /cvsroot/mozilla/webtools/bugzilla/post_bug.cgi,v <-- post_bug.cgi new revision: 1.140; previous revision: 1.139 done Checking in query.cgi; /cvsroot/mozilla/webtools/bugzilla/query.cgi,v <-- query.cgi new revision: 1.158; previous revision: 1.157 done Checking in Bugzilla/Version.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Version.pm,v <-- Version.pm new revision: 1.9; previous revision: 1.8 done Checking in template/en/default/admin/flag-type/edit.html.tmpl; /cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/flag-type/edit.html.tmpl,v <-- edit.html.tmpl new revision: 1.16; previous revision: 1.15 done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: