diff options
Diffstat (limited to 'editproducts.cgi')
-rwxr-xr-x | editproducts.cgi | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/editproducts.cgi b/editproducts.cgi index b458f60bf..dac5799ad 100755 --- a/editproducts.cgi +++ b/editproducts.cgi @@ -408,9 +408,16 @@ if ($action eq 'delete') { $dbh->bz_lock_tables('products WRITE', 'components WRITE', 'versions WRITE', 'milestones WRITE', - 'group_control_map WRITE', + 'group_control_map WRITE', 'component_cc WRITE', 'flaginclusions WRITE', 'flagexclusions WRITE'); + my $comp_ids = $dbh->selectcol_arrayref('SELECT id FROM components + WHERE product_id = ?', + undef, $product->id); + + $dbh->do('DELETE FROM component_cc WHERE component_id IN + (' . join(',', @$comp_ids) . ')') if scalar(@$comp_ids); + $dbh->do("DELETE FROM components WHERE product_id = ?", undef, $product->id); |