-
Notifications
You must be signed in to change notification settings - Fork 5
Description
When simulating a user login via the users module the following happens in SwitchUserRoleHook->setUserGroup():
tx_begroupsroles_roleis read from the sessiontx_begroupsroles_role===null(that's the case when the user has never logged in) thentx_begroupsroles_groupsis being calculated- the first one of these
tx_begroupsroles_groupsis set as thetx_begroupsroles_rolein the session
When simulating another user (that hasn't logged in before!!) the session is still holding that tx_begroupsroles_role and this skips the dermination of tx_begroupsroles_groups and that leads to an error in https://github.com/IchHabRecht/begroups_roles/blob/master/Classes/Hook/SwitchUserRoleHook.php#L90
$possibleUsergroups = GeneralUtility::intExplode(',', $this->backendUser->user['tx_begroupsroles_groups'], true);PHP Runtime Deprecation Notice: explode(): Passing null to parameter #2 ($string) of type string is deprecated in GeneralUtility.php line 936
I believe that this error only occurs when simulating users, not when users regularly log in and use the whole role-feature.
A possible solution might be to hook into the exit-simulation part (EXT:backend/Controller/SwitchUserController->exitSwitchUserAction()) and do this:
$sessionObject->set('backuserid', null);
+ $sessionObject->set('tx_begroupsroles_role', null);