1.10.x
Julio Montoya 10 years ago
parent 099b17f076
commit d3b5c0679b
  1. 27
      main/install/install.lib.php

@ -2035,8 +2035,14 @@ function migrate($chamiloVersion, EntityManager $manager)
*/
function fixIds(EntityManager $em)
{
$debug = true;
$connection = $em->getConnection();
if ($debug) {
error_log('fixIds');
error_log('Update tools');
}
$sql = "SELECT * FROM c_lp_item";
$result = $connection->fetchAll($sql);
foreach ($result as $item) {
@ -2094,6 +2100,7 @@ function fixIds(EntityManager $em)
if (!empty($sql) && !empty($newId) && !empty($iid)) {
$sql = "UPDATE c_lp_item SET ref = $newId WHERE iid = $iid";
$connection->executeQuery($sql);
}
}
@ -2122,6 +2129,10 @@ function fixIds(EntityManager $em)
// This updates the group_id with c_group_info.iid instead of c_group_info.id
if ($debug) {
error_log('update iids');
}
$groupTableToFix = [
'c_group_rel_user',
'c_group_rel_tutor',
@ -2160,7 +2171,9 @@ function fixIds(EntityManager $em)
}
// Fix c_item_property
if ($debug) {
error_log('update c_item_property');
}
$sql = "SELECT * FROM c_item_property";
$result = $connection->fetchAll($sql);
foreach ($result as $item) {
@ -2221,6 +2234,10 @@ function fixIds(EntityManager $em)
}
}
if ($debug) {
error_log('update gradebook_link');
}
// Fix gradebook_link
$sql = "SELECT * FROM gradebook_link";
$result = $connection->fetchAll($sql);
@ -2265,6 +2282,10 @@ function fixIds(EntityManager $em)
}
}
if ($debug) {
error_log('update groups');
}
$sql = "SELECT * FROM groups";
$result = $connection->executeQuery($sql);
$groups = $result->fetchAll();
@ -2366,6 +2387,10 @@ function fixIds(EntityManager $em)
}
}
if ($debug) {
error_log('update extra fields');
}
// Extra fields
$extraFieldTables = [
ExtraField::USER_FIELD_TYPE => Database::get_main_table(TABLE_MAIN_USER_FIELD),

Loading…
Cancel
Save