Skip to content
Snippets Groups Projects
Commit fbb83ec6 authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #15826 TIME 0:20 error in user redirection

parent adafcc31
No related branches found
No related tags found
No related merge requests found
......@@ -271,7 +271,13 @@ class ListInstanceController
return ['errors' => 'User not found', 'code' => 400];
}
} elseif (in_array($instance['item_type'], ['entity_id', 'entity'])) {
$entity = EntityModel::getById(['id' => $instance['item_id'], 'select' => ['enabled']]);
if (!is_numeric($instance['item_id'])) {
$entity = EntityModel::getByEntityId(['entityId' => $instance['item_id'], 'select' => ['id', 'enabled']]);
$instance['item_id'] = $entity['id'];
} else {
$entity = EntityModel::getById(['id' => $instance['item_id'], 'select' => ['enabled']]);
}
$instance['item_type'] = 'entity_id';
if (empty($entity) || $entity['enabled'] != 'Y') {
DatabaseModel::rollbackTransaction();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment