Skip to content

Commit

Permalink
[BUGFIX] Properly initialize backend user for requests
Browse files Browse the repository at this point in the history
Default requests won't have a workspace id.
That will lead to TYPO3 defaults -99 id.
That in turn will lead to being in preview mode once a backend user is
provided within context.

We therefore cover the default and turn it into live workspace which
could be the expected default.

Also we add missing initialization for backend user.

Resolves: #535
  • Loading branch information
DanielSiepmann committed Feb 12, 2024
1 parent ee62a11 commit 3297eff
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
// Init backend user if found in database
$backendUser = GeneralUtility::makeInstance(FrontendBackendUserAuthentication::class);
$backendUser->user = $row;
$backendUser->uc = isset($row['uc']) ? unserialize($row['uc']) : [];
$backendUser->initializeUserSessionManager();
$backendUser->fetchGroupData();
$workspaceId = $workspaceId ?? 0;
if ($workspaceId !== null) {
// Force backend user into given workspace, can be 0, too.
$backendUser->setTemporaryWorkspace($workspaceId);
Expand Down

0 comments on commit 3297eff

Please sign in to comment.