From 4f3f2faf7f1f6ee3bfcab89f284615d409a11111 Mon Sep 17 00:00:00 2001
From: "florian.azizian" <florian.azizian@maarch.org>
Date: Wed, 13 Jan 2021 10:07:44 +0100
Subject: [PATCH] FIX #15826 TIME 0:15 error in user redirection

---
 src/app/action/controllers/PreProcessActionController.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/app/action/controllers/PreProcessActionController.php b/src/app/action/controllers/PreProcessActionController.php
index 7e72693450e..3fb9294fae4 100755
--- a/src/app/action/controllers/PreProcessActionController.php
+++ b/src/app/action/controllers/PreProcessActionController.php
@@ -1422,13 +1422,13 @@ class PreProcessActionController
             return $response->withStatus(403)->withJson(['errors' => 'Document out of perimeter']);
         }
 
-        $user = UserModel::getById(['id' => $args['userId'], 'select' => ['user_id']]);
+        $user = UserModel::getById(['id' => $args['userId'], 'select' => ['id']]);
         if (empty($user)) {
             return $response->withStatus(400)->withJson(['errors' => 'User does not exist']);
         }
 
         $changeDestination = true;
-        $entities = UserEntityModel::get(['select' => ['entity_id'], 'where' => ['user_id = ?'], 'data' => [$user['user_id']]]);
+        $entities = UserEntityModel::get(['select' => ['entity_id'], 'where' => ['user_id = ?'], 'data' => [$user['id']]]);
         $resource = ResModel::getById(['select' => ['destination'], 'resId' => $args['resId']]);
         foreach ($entities as $entity) {
             if ($entity['entity_id'] == $resource['destination']) {
-- 
GitLab