From 73ac7dc3a34ae3e342a37ab16f4b3bf521a74d55 Mon Sep 17 00:00:00 2001 From: Bodo-Merle Sandor Date: Sat, 20 Feb 2010 16:57:32 +0100 Subject: [PATCH] Bug 547428: SQL error when deleting a product and its related series when it has none r/a=LpSolit --- Bugzilla/Product.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Bugzilla/Product.pm b/Bugzilla/Product.pm index c993905db9..359a574417 100644 --- a/Bugzilla/Product.pm +++ b/Bugzilla/Product.pm @@ -411,7 +411,9 @@ sub remove_from_db { WHERE series_categories.name = ?', undef, $self->name); - $dbh->do('DELETE FROM series WHERE ' . $dbh->sql_in('series_id', $series_ids)); + if (scalar @$series_ids) { + $dbh->do('DELETE FROM series WHERE ' . $dbh->sql_in('series_id', $series_ids)); + } # If no subcategory uses this product name, completely purge it. my $in_use = -- 2.47.2