Verified Commit abfe61a9 authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #17113 TIME 1 Can not redirect document when user_id contains only number

parent 449aa20e
......@@ -266,7 +266,7 @@ class ListInstanceController
}
if (in_array($instance['item_type'], ['user_id', 'user'])) {
if (!is_numeric($instance['item_id'])) {
if ($instance['item_type'] == 'user_id') {
$user = UserModel::getByLogin(['login' => $instance['item_id'], 'select' => ['id']]);
$instance['item_id'] = $user['id'] ?? null;
} else {
......@@ -497,7 +497,7 @@ class ListInstanceController
return $response->withStatus(400)->withJson(['errors' => "Body resources[{$resourceKey}] listInstances[{$key}] sequence is before already processed users"]);
}
if (!is_numeric($listInstance['item_id'])) {
if ($listInstance['item_type'] == 'user_id') {
$user = UserModel::getByLogin(['login' => $listInstance['item_id'], 'select' => ['id'], 'noDeleted' => true]);
$listInstance['item_id'] = $user['id'] ?? null;
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment