Skip to content

Commit

Permalink
4150 - use already defined workspace name
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernhard Schmitt committed May 11, 2024
1 parent 07f031f commit e07783c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function updateSiteAction(Site $site, $newSiteNodeName)
}

foreach ($contentRepository->getWorkspaceFinder()->findAll() as $workspace) {
$siteNodeAggregate = $contentRepository->getContentGraph(WorkspaceName::forLive())->findChildNodeAggregateByName(
$siteNodeAggregate = $contentRepository->getContentGraph($workspace->workspaceName)->findChildNodeAggregateByName(
$sitesNode->nodeAggregateId,
$site->getNodeName()->toNodeName()
);
Expand Down
10 changes: 5 additions & 5 deletions Neos.Neos/Classes/Domain/Service/SiteServiceInternals.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
use Neos\ContentRepository\Core\SharedModel\Exception\NodeTypeNotFoundException;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeVariantSelectionStrategy;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
use Neos\Neos\Domain\Exception\SiteNodeTypeIsInvalid;
use Neos\Neos\Domain\Model\Site;
use Neos\Neos\Domain\Model\SiteNodeName;
Expand Down Expand Up @@ -96,10 +95,11 @@ public function createSiteNodeIfNotExists(Site $site, string $nodeTypeName): voi
throw SiteNodeTypeIsInvalid::becauseItIsNotOfTypeSite(NodeTypeName::fromString($nodeTypeName));
}

$siteNodeAggregate = $this->contentRepository->getContentGraph(WorkspaceName::forLive())->findChildNodeAggregateByName(
$sitesNodeIdentifier,
$site->getNodeName()->toNodeName(),
);
$siteNodeAggregate = $this->contentRepository->getContentGraph($liveWorkspace->workspaceName)
->findChildNodeAggregateByName(
$sitesNodeIdentifier,
$site->getNodeName()->toNodeName(),
);
if ($siteNodeAggregate instanceof NodeAggregate) {
// Site node already exists
return;
Expand Down

0 comments on commit e07783c

Please sign in to comment.