Internal: Simplify conditions to set resource node creator - refs BT#22193

pull/5924/head
Angel Fernando Quiroz Campos 10 months ago
parent 27cc4ae121
commit 05eba81930
No known key found for this signature in database
GPG Key ID: B284841AE3E562CD
  1. 20
      src/CoreBundle/Migrations/AbstractMigrationChamilo.php

@ -292,20 +292,14 @@ abstract class AbstractMigrationChamilo extends AbstractMigration
}
// If c_item_property.insert_user_id doesn't exist we use the first admin id.
$user = null;
if (isset($userList[$userId])) {
$user = $userList[$userId];
} else {
if (!empty($userId)) {
$userFound = $userRepo->find($userId);
if ($userFound) {
$user = $userList[$userId] = $userRepo->find($userId);
}
}
}
$user = $admin;
if (null === $user) {
$user = $admin;
if ($userId) {
if (isset($userList[$userId])) {
$user = $userList[$userId];
} elseif ($userFound = $userRepo->find($userId)) {
$user = $userList[$userId] = $userFound;
}
}
$session = null;

Loading…
Cancel
Save