Commit 09df4b6f authored by Bodo-Merle Sandor's avatar Bodo-Merle Sandor Committed by Frédéric Buclin

Bug 547428: SQL error when deleting a product and its related series when it has none

r/a=LpSolit
parent b9022b0d
...@@ -298,7 +298,9 @@ sub remove_from_db { ...@@ -298,7 +298,9 @@ sub remove_from_db {
WHERE series_categories.name = ?', WHERE series_categories.name = ?',
undef, $self->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. # If no subcategory uses this product name, completely purge it.
my $in_use = my $in_use =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment