From 1265dfc3c19b835b8c1befbfa145f9fac2a2052c Mon Sep 17 00:00:00 2001 From: jmontoya Date: Wed, 2 Mar 2016 12:38:32 +0100 Subject: [PATCH] Fix upgrade see BT#10730 --- main/install/install.lib.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/main/install/install.lib.php b/main/install/install.lib.php index 8716d972f1..3c68e64615 100755 --- a/main/install/install.lib.php +++ b/main/install/install.lib.php @@ -2405,8 +2405,18 @@ function fixIds(EntityManager $em) foreach ($dataList as $data) { if (isset($oldGroups[$data['group_id']])) { $data['group_id'] = $oldGroups[$data['group_id']]; + + $userId = $data['user_id']; + + $sql = "SELECT id FROM user WHERE user_id = $userId"; + $userResult = $connection->executeQuery($sql); + $userInfo = $userResult->fetch(); + if (empty($userInfo)) { + continue; + } + $sql = "INSERT INTO usergroup_rel_user (usergroup_id, user_id, relation_type) - VALUES ('{$data['group_id']}', '{$data['user_id']}', '{$data['relation_type']}')"; + VALUES ('{$data['group_id']}', '{$userId}', '{$data['relation_type']}')"; $connection->executeQuery($sql); } }