Skip to content

Commit

Permalink
TASK: Use getCurrentBaseWorkspace of Neos.Neos' Workspace model...
Browse files Browse the repository at this point in the history
...to retrieve the base workspace during publish opertaions.

As suggested by @nezaniel (see:
#3759 (comment))
  • Loading branch information
grebaldi committed Apr 22, 2024
1 parent fd1baeb commit 455ff67
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions Classes/Controller/BackendServiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,10 @@ public function publishChangesInSiteAction(array $command): void
$publishingResult = $workspace
->publishChangesInSite($command->siteId);

$contentRepository = $this->contentRepositoryRegistry->get($contentRepositoryId);
$baseWorkspaceName = $contentRepository->getWorkspaceFinder()->findOneByName($command->workspaceName)->baseWorkspaceName;

$this->view->assign('value', [
'success' => [
'numberOfAffectedChanges' => $publishingResult->numberOfPublishedChanges,
'baseWorkspaceName' => $baseWorkspaceName->value
'baseWorkspaceName' => $workspace->getCurrentBaseWorkspaceName()?->value
]
]);
} catch (\Exception $e) {
Expand Down Expand Up @@ -239,10 +236,6 @@ public function publishChangesInDocumentAction(array $command): void
$command = PublishChangesInDocument::fromArray($command);

$contentRepositoryId = SiteDetectionResult::fromRequest($this->request->getHttpRequest())->contentRepositoryId;
$contentRepository = $this->contentRepositoryRegistry->get($contentRepositoryId);
$baseWorkspaceName = $contentRepository->getWorkspaceFinder()->findOneByName(
$command->workspaceName
)->baseWorkspaceName;

try {
$workspace = $this->workspaceProvider->provideForWorkspaceName(
Expand All @@ -254,7 +247,7 @@ public function publishChangesInDocumentAction(array $command): void
$this->view->assign('value', [
'success' => [
'numberOfAffectedChanges' => $publishingResult->numberOfPublishedChanges,
'baseWorkspaceName' => $baseWorkspaceName->value
'baseWorkspaceName' => $workspace->getCurrentBaseWorkspaceName()?->value
]
]);
} catch (NodeAggregateCurrentlyDoesNotExist $e) {
Expand Down

0 comments on commit 455ff67

Please sign in to comment.