diff options
author | lpsolit%gmail.com <> | 2005-05-06 04:20:44 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2005-05-06 04:20:44 +0200 |
commit | d320ac0ee8de76512a87f5cbcf08350ae4ecc652 (patch) | |
tree | 96b65c444a6884d099eb59e7f5207d26c5c660a5 /Bugzilla | |
parent | dfbc39b00d9dc7f38fa01de7b73569e4dacf1c91 (diff) | |
download | bugzilla-d320ac0ee8de76512a87f5cbcf08350ae4ecc652.tar.gz bugzilla-d320ac0ee8de76512a87f5cbcf08350ae4ecc652.tar.xz |
Bug 288663: The inclusion and exclusion lists behave incorrectly when a product or a component is called "Any" - Patch by Frédéric Buclin <LpSolit@gmail.com> r=myk a=myk
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/FlagType.pm | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/Bugzilla/FlagType.pm b/Bugzilla/FlagType.pm index 6b4c31c7f..d07bb0b65 100644 --- a/Bugzilla/FlagType.pm +++ b/Bugzilla/FlagType.pm @@ -184,7 +184,9 @@ sub get_exclusions { =item C<get_clusions($id, $type)> -Someone please document this +Return a hash of product/component IDs and names +associated with the flagtype: +$clusions{'product_name:component_name'} = "product_ID:component_ID" =back @@ -192,23 +194,29 @@ Someone please document this sub get_clusions { my ($id, $type) = @_; - - &::PushGlobalSQLState(); - &::SendSQL("SELECT products.name, components.name " . - "FROM flagtypes, flag${type}clusions " . - "LEFT OUTER JOIN products ON flag${type}clusions.product_id = products.id " . - "LEFT OUTER JOIN components ON flag${type}clusions.component_id = components.id " . - "WHERE flagtypes.id = $id AND flag${type}clusions.type_id = flagtypes.id"); - my @clusions = (); - while (&::MoreSQLData()) { - my ($product, $component) = &::FetchSQLData(); - $product ||= "Any"; - $component ||= "Any"; - push(@clusions, "$product:$component"); + my $dbh = Bugzilla->dbh; + + my $list = + $dbh->selectall_arrayref("SELECT products.id, products.name, " . + " components.id, components.name " . + "FROM flagtypes, flag${type}clusions " . + "LEFT OUTER JOIN products " . + " ON flag${type}clusions.product_id = products.id " . + "LEFT OUTER JOIN components " . + " ON flag${type}clusions.component_id = components.id " . + "WHERE flagtypes.id = ? " . + " AND flag${type}clusions.type_id = flagtypes.id", + undef, $id); + my %clusions; + foreach my $data (@$list) { + my ($product_id, $product_name, $component_id, $component_name) = @$data; + $product_id ||= 0; + $product_name ||= "__Any__"; + $component_id ||= 0; + $component_name ||= "__Any__"; + $clusions{"$product_name:$component_name"} = "$product_id:$component_id"; } - &::PopGlobalSQLState(); - - return \@clusions; + return \%clusions; } =pod |