Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/9.0' into feature/overhaulNodeUr…
Browse files Browse the repository at this point in the history
…iBuilding
  • Loading branch information
mhsdesign committed Jun 14, 2024
1 parent 9387ba3 commit 1733e89
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions Classes/Controller/WorkspaceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use Neos\ContentRepository\Core\Projection\ContentGraph\Nodes;
use Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints;
use Neos\ContentRepository\Core\Projection\Workspace\Workspace;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAddress;
use Neos\ContentRepository\Core\SharedModel\Node\NodeName;
use Neos\ContentRepository\Core\SharedModel\User\UserId;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
Expand Down Expand Up @@ -62,8 +63,9 @@
use Neos\Neos\Domain\Workspace\DiscardAllChanges;
use Neos\Neos\Domain\Workspace\PublishAllChanges;
use Neos\Neos\Domain\Workspace\WorkspaceProvider;
use Neos\Neos\FrontendRouting\NodeAddress;
use Neos\Neos\FrontendRouting\NodeAddress as LegacyNodeAddress;
use Neos\Neos\FrontendRouting\NodeAddressFactory;
use Neos\Neos\FrontendRouting\NodeUriBuilderFactory;
use Neos\Neos\FrontendRouting\SiteDetection\SiteDetectionResult;
use Neos\Neos\PendingChangesProjection\ChangeFinder;
use Neos\Neos\Utility\NodeTypeWithFallbackProvider;
Expand All @@ -80,6 +82,9 @@ class WorkspaceController extends AbstractModuleController
#[Flow\Inject]
protected ContentRepositoryRegistry $contentRepositoryRegistry;

#[Flow\Inject]
protected NodeUriBuilderFactory $nodeUriBuilderFactory;

#[Flow\Inject]
protected SiteRepository $siteRepository;

Expand Down Expand Up @@ -476,31 +481,36 @@ public function rebaseAndRedirectAction(Node $targetNode, Workspace $targetWorks
* }
*/

$targetNodeAddressInPersonalWorkspace = new NodeAddress(
$personalWorkspace->currentContentStreamId,
$targetNodeAddressInPersonalWorkspace = NodeAddress::create(
$targetNode->contentRepositoryId,
$personalWorkspace->workspaceName,
$targetNode->dimensionSpacePoint,
$targetNode->aggregateId,
$personalWorkspace->workspaceName
$targetNode->aggregateId
);

$mainRequest = $this->controllerContext->getRequest()->getMainRequest();
/** @var ActionRequest $mainRequest */
$this->uriBuilder->setRequest($mainRequest);

if ($this->packageManager->isPackageAvailable('Neos.Neos.Ui')) {
// todo remove me legacy
$legacyTargetNodeAddressInPersonalWorkspace = new LegacyNodeAddress(
$personalWorkspace->currentContentStreamId,
$targetNodeAddressInPersonalWorkspace->dimensionSpacePoint,
$targetNodeAddressInPersonalWorkspace->aggregateId,
$targetNodeAddressInPersonalWorkspace->workspaceName
);
$mainRequest = $this->controllerContext->getRequest()->getMainRequest();
/** @var ActionRequest $mainRequest */
$this->uriBuilder->setRequest($mainRequest);

$this->redirect(
'index',
'Backend',
'Neos.Neos.Ui',
['node' => $targetNodeAddressInPersonalWorkspace]
['node' => $legacyTargetNodeAddressInPersonalWorkspace]
);
}

$this->redirect(
'show',
'Frontend\\Node',
'Neos.Workspace.Ui',
['node' => $targetNodeAddressInPersonalWorkspace]
$this->redirectToUri(
$this->nodeUriBuilderFactory->forActionRequest($this->request)
->uriFor($targetNodeAddressInPersonalWorkspace)
);
}

Expand Down Expand Up @@ -823,7 +833,7 @@ protected function computeSiteChanges(Workspace $selectedWorkspace, ContentRepos
// As for changes of type `delete` we are using nodes from the live content stream
// we can't create `serializedNodeAddress` from the node.
// Instead, we use the original stored values.
$nodeAddress = new NodeAddress(
$nodeAddress = new LegacyNodeAddress(
$change->contentStreamId,
$change->originDimensionSpacePoint->toDimensionSpacePoint(),
$change->nodeAggregateId,
Expand Down

0 comments on commit 1733e89

Please sign in to comment.