Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
bwaidelich committed Sep 6, 2024
1 parent 06e0bdf commit 9788dce
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
27 changes: 12 additions & 15 deletions Classes/Controller/BackendServiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,24 +453,21 @@ public function changeBaseWorkspaceAction(string $targetWorkspaceName, string $d
// todo ensure that https://github.com/neos/neos-ui/pull/3734 doesnt need to be refixed in Neos 9.0
$redirectNode = $documentNodeInstance;
while (true) {
// @phpstan-ignore-next-line
$redirectNodeInBaseWorkspace = $subgraph->findNodeById($redirectNode->aggregateId);
if ($redirectNodeInBaseWorkspace) {
break;
} else {
// @phpstan-ignore-next-line
$redirectNode = $subgraph->findParentNode($redirectNode->aggregateId);
// get parent always returns Node
if (!$redirectNode) {
throw new \Exception(
sprintf(
'Wasn\'t able to locate any valid node in rootline of node %s in the workspace %s.',
$documentNodeInstance->aggregateId->value,
$targetWorkspaceName
),
1458814469
);
}
}
$redirectNode = $subgraph->findParentNode($redirectNode->aggregateId);
// get parent always returns Node
if (!$redirectNode) {
throw new \Exception(
sprintf(
'Wasn\'t able to locate any valid node in rootline of node %s in the workspace %s.',
$documentNodeInstance->aggregateId->value,
$targetWorkspaceName
),
1458814469
);
}
}

Expand Down
3 changes: 2 additions & 1 deletion Classes/Domain/Model/Changes/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ private function handleNodeReferenceChange(Node $subject, string $propertyName):
$subject->workspaceName,
$subject->aggregateId,
$subject->originDimensionSpacePoint,
NodeReferencesToWrite::fromNodeAggregateIds(ReferenceName::fromString($propertyName), NodeAggregateIds::fromArray($destinationNodeAggregateIds))
ReferenceName::fromString($propertyName),
NodeReferencesToWrite::fromNodeAggregateIds(NodeAggregateIds::fromArray($destinationNodeAggregateIds))
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function isSimilarTo(FeedbackInterface $feedback)
return false;
}
$feedbackWorkspaceName = $feedback->getWorkspaceName();
return $feedbackWorkspaceName !== null && $this->getWorkspaceName()?->equals($feedbackWorkspaceName);
return $feedbackWorkspaceName !== null && $this->getWorkspaceName()->equals($feedbackWorkspaceName);
}

/**
Expand All @@ -99,11 +99,8 @@ public function isSimilarTo(FeedbackInterface $feedback)
*/
public function serializePayload(ControllerContext $controllerContext)
{
if (!$this->workspaceName) {
return null;
}
$contentRepository = $this->contentRepositoryRegistry->get($this->contentRepositoryId);
$workspace = $contentRepository->findWorkspaceByName($this->workspaceName);
$workspace = $contentRepository->getWorkspaceFinder()->findOneByName($this->workspaceName);
if ($workspace === null) {
return null;
}
Expand Down

0 comments on commit 9788dce

Please sign in to comment.