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. 16
      src/CoreBundle/Migrations/AbstractMigrationChamilo.php

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

Loading…
Cancel
Save