Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
/** @var InternalRequestContext $internalRequestContext */
$internalRequestContext = $request->getAttribute('typo3.testing.context');
$backendUserId = $internalRequestContext->getBackendUserId();
$workspaceId = $internalRequestContext->getWorkspaceId();
$workspaceId = $internalRequestContext->getWorkspaceId() ?? 0;

if ((int)$backendUserId === 0) {
// Skip if $backendUserId is invalid, typically null or 0
Expand All @@ -55,10 +55,10 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
// Init backend user if found in database
$backendUser = GeneralUtility::makeInstance(FrontendBackendUserAuthentication::class);
$backendUser->user = $row;
if ($workspaceId !== null) {
// Force backend user into given workspace, can be 0, too.
$backendUser->setTemporaryWorkspace($workspaceId);
}
$backendUser->uc = isset($row['uc']) ? unserialize($row['uc']) : [];
$backendUser->initializeUserSessionManager();
$backendUser->fetchGroupData();
$backendUser->setTemporaryWorkspace($workspaceId);
$GLOBALS['BE_USER'] = $backendUser;
$this->setBackendUserAspect(GeneralUtility::makeInstance(Context::class), $backendUser);
}
Expand Down