Commit 1a3c26e6 authored by bugreport%peshkin.net's avatar bugreport%peshkin.net

Bug 185760: New group system doesn't upgrade transparently if usebuggroups = 0

r=justdave a=justdave
parent 3154b337
...@@ -3472,15 +3472,13 @@ if (TableExists("attachstatuses") && TableExists("attachstatusdefs")) { ...@@ -3472,15 +3472,13 @@ if (TableExists("attachstatuses") && TableExists("attachstatusdefs")) {
# 2002-11-24 - bugreport@peshkin.net - bug 147275 # 2002-11-24 - bugreport@peshkin.net - bug 147275
# #
if (Param('makeproductgroups')) { # If group_control_map is empty, backward-compatbility
# If makeproductgroups is enabled and group_control_map is empty, # usebuggroups-equivalent records should be created.
# backward-compatbility usebuggroups-equivalent records should my $entry = Param('useentrygroupdefault');
# be created. $sth = $dbh->prepare("SELECT COUNT(*) FROM group_control_map");
my $entry = Param('useentrygroupdefault'); $sth->execute();
$sth = $dbh->prepare("SELECT COUNT(*) FROM group_control_map"); my ($mapcnt) = $sth->fetchrow_array();
$sth->execute(); if ($mapcnt == 0) {
my ($mapcnt) = $sth->fetchrow_array();
if ($mapcnt == 0) {
# Initially populate group_control_map. # Initially populate group_control_map.
# First, get all the existing products and their groups. # First, get all the existing products and their groups.
$sth = $dbh->prepare("SELECT groups.id, products.id, groups.name, " . $sth = $dbh->prepare("SELECT groups.id, products.id, groups.name, " .
...@@ -3515,7 +3513,6 @@ if (Param('makeproductgroups')) { ...@@ -3515,7 +3513,6 @@ if (Param('makeproductgroups')) {
} }
} }
} }
}
} }
# If you had to change the --TABLE-- definition in any way, then add your # If you had to change the --TABLE-- definition in any way, then add your
......
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