Skip to content

Commit

Permalink
BUGFIX: Remove rootnode when user workspace is deleted
Browse files Browse the repository at this point in the history
Fixes: #2193
  • Loading branch information
Sebobo committed Aug 16, 2024
1 parent 4d9c968 commit 7b75c2b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Neos.Neos/Classes/Domain/Service/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -902,8 +902,13 @@ protected function deletePersonalWorkspace($accountIdentifier)
{
$userWorkspace = $this->workspaceRepository->findByIdentifier(UserUtility::getPersonalWorkspaceNameForUsername($accountIdentifier));
if ($userWorkspace instanceof Workspace) {
$rootNode = $userWorkspace->getRootNodeData();
$this->publishingService->discardAllNodes($userWorkspace);
$this->workspaceRepository->remove($userWorkspace);

// Persist removal of workspace so we can remove the root node without a foreign key constraint violation
$this->persistenceManager->persistAll();
$rootNode->remove();
}
}

Expand Down

0 comments on commit 7b75c2b

Please sign in to comment.