Skip to content

Commit

Permalink
Merge pull request #5207 from neos/bugfix/remove-rootnode-when-deleti…
Browse files Browse the repository at this point in the history
…ng-users

BUGFIX: Remove rootnode when user workspace is deleted
  • Loading branch information
Sebobo committed Sep 9, 2024
2 parents aaddb43 + 7b75c2b commit e491b59
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 e491b59

Please sign in to comment.