Commit cb16470a authored by Laurent Lécluse's avatar Laurent Lécluse
Browse files

Correction d'une notice qui aparaissait si on n'tait pas connecté: pas de selectable role

parent 40bb0af6
......@@ -335,12 +335,15 @@ class UserContext extends AbstractService implements EventManagerAwareInterface
unset($this->getSessionContainer()->selectedIdentityRole);
}
$role = $this->getSelectableIdentityRoles()[$role];
if ($role instanceof AbstractRole) {
$this->saveUserLastRole($role);
}
$selectableIdentityRoles = $this->getSelectableIdentityRoles();
if (isset($selectableIdentityRoles[$role])){
$role = $selectableIdentityRoles[$role];
if ($role instanceof AbstractRole) {
$this->saveUserLastRole($role);
}
$this->triggerUserRoleSelectedEvent(UserRoleSelectedEvent::POST_SELECTION, $role);
$this->triggerUserRoleSelectedEvent(UserRoleSelectedEvent::POST_SELECTION, $role);
}
return $this;
}
......
Markdown is supported
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