aboutsummaryrefslogtreecommitdiffstats
path: root/editproducts.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2007-07-12 07:40:02 +0000
committerlpsolit%gmail.com <>2007-07-12 07:40:02 +0000
commit23c63e06693b324f5ea61555fd150ac4a158679a (patch)
tree530bc8940870b2b1c1d5643dff313da6c99559e8 /editproducts.cgi
parentdc9f2badbb567a3104c72cc148c78cf587f03a43 (diff)
downloadbugs-23c63e06693b324f5ea61555fd150ac4a158679a.tar
bugs-23c63e06693b324f5ea61555fd150ac4a158679a.tar.gz
bugs-23c63e06693b324f5ea61555fd150ac4a158679a.tar.bz2
bugs-23c63e06693b324f5ea61555fd150ac4a158679a.tar.xz
bugs-23c63e06693b324f5ea61555fd150ac4a158679a.zip
Bug 387831: Deleting products does not clean up the component_cc table - Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=mkanat
Diffstat (limited to 'editproducts.cgi')
-rwxr-xr-xeditproducts.cgi9
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);