Closed
Bug 451716
Opened 16 years ago
Closed 15 years ago
Deleting a product does not remove its entries from the 'Series' table.
Categories
(Bugzilla :: Administration, task)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.6
People
(Reporter: LpSolit, Assigned: LpSolit)
References
Details
Attachments
(1 file)
3.72 KB,
patch
|
gerv
:
review+
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #247936 +++
In bug 247936, we fixed the crash by making sure the series was not already in the DB when recreating the same product or component again. There has been some discussion about why the series have not been deleted at the same time as the product or component themselves.
The trend seems to be that deleting a product should also delete related series (and if you don't want to loose the data, don't delete the product).
Everybody has been CC'ed as I cloned the bug.
Assignee | ||
Comment 1•15 years ago
|
||
Now that bug 302542 is fixed, all I need to do is to invoke $series->remove_from_db() if the admin decides to remove related series when deleting a product.
Assignee: administration → LpSolit
Severity: normal → enhancement
Status: NEW → ASSIGNED
No longer depends on: 230254
Target Milestone: --- → Bugzilla 3.6
Assignee | ||
Comment 2•15 years ago
|
||
Attachment #413425 -
Flags: review?(gerv)
Comment 3•15 years ago
|
||
Comment on attachment 413425 [details] [diff] [review]
patch, v1
r=gerv.
Gerv
Attachment #413425 -
Flags: review?(gerv) → review+
Assignee | ||
Updated•15 years ago
|
Flags: approval+
Assignee | ||
Comment 4•15 years ago
|
||
Checking in editproducts.cgi;
/cvsroot/mozilla/webtools/bugzilla/editproducts.cgi,v <-- editproducts.cgi
new revision: 1.151; previous revision: 1.150
done
Checking in Bugzilla/Product.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Product.pm,v <-- Product.pm
new revision: 1.41; previous revision: 1.40
done
Checking in template/en/default/admin/products/confirm-delete.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/products/confirm-delete.html.tmpl,v <-- confirm-delete.html.tmpl
new revision: 1.13; previous revision: 1.12
done
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 5•15 years ago
|
||
Trying to delete the test product from a fresh install (from bzr trunk), yield the following error:
DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 [for Statement "DELETE FROM series WHERE series_id IN () "] at Bugzilla/Product.pm line 301
Bugzilla::Product::remove_from_db('Bugzilla::Product=HASH(0x997a3e8)', 'HASH(0x9830598)') called at /home/sbodo/workspace/foss/bzr/mozilla.org/bugzilla/editproducts.cgi line 235
So the delete statement should be executed only when the previous select yields some result in $series_ids:
$dbh->do('DELETE FROM series WHERE ' . $dbh->sql_in('series_id', $series_ids)) if $series_ids;
Comment 6•15 years ago
|
||
=== modified file 'Bugzilla/Product.pm'
--- Bugzilla/Product.pm 2010-02-15 23:22:55 +0000
+++ Bugzilla/Product.pm 2010-02-20 12:58:44 +0000
@@ -298,7 +298,7 @@
WHERE series_categories.name = ?',
undef, $self->name);
- $dbh->do('DELETE FROM series WHERE ' . $dbh->sql_in('series_id', $series_ids));
+ $dbh->do('DELETE FROM series WHERE ' . $dbh->sql_in('series_id', $series_ids)) if @{$series_ids};
# If no subcategory uses this product name, completely purge it.
my $in_use =
(In reply to comment #5)
> Trying to delete the test product from a fresh install (from bzr trunk), yield
> the following error:
>
> DBD::mysql::db do failed: You have an error in your SQL syntax; check the
> manual that corresponds to your MySQL server version for the right syntax to
> use near ')' at line 1 [for Statement "DELETE FROM series WHERE series_id IN
> () "] at Bugzilla/Product.pm line 301
> Bugzilla::Product::remove_from_db('Bugzilla::Product=HASH(0x997a3e8)',
> 'HASH(0x9830598)') called at
> /home/sbodo/workspace/foss/bzr/mozilla.org/bugzilla/editproducts.cgi line 235
>
> So the delete statement should be executed only when the previous select yields
> some result in $series_ids:
>
> $dbh->do('DELETE FROM series WHERE ' . $dbh->sql_in('series_id', $series_ids))
> if $series_ids;
Assignee | ||
Comment 7•15 years ago
|
||
(In reply to comment #6)
> === modified file 'Bugzilla/Product.pm'
> --- Bugzilla/Product.pm 2010-02-15 23:22:55 +0000
> +++ Bugzilla/Product.pm 2010-02-20 12:58:44 +0000
Bodo-Merle Sandor, could you please file a separate bug, attach this patch and ask me for review? If not, I can file it and attach your patch myself, if you prefer.
You need to log in
before you can comment on or make changes to this bug.
Description
•