From d0c743c38d27f88bb443355c2ce55e7b1042bb4e Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Sat, 16 Sep 2023 21:10:52 +0200 Subject: [PATCH] Revert "TASK: Add rudimentary support for EditPreviewModes in 9.0" This reverts commit ce395ca9e3614ec32f7af7a82d2759a74e68f62d. --- .../Operations/ReloadContentOutOfBand.php | 15 +-------------- .../Operations/RenderContentOutOfBand.php | 15 +-------------- Classes/Fusion/Helper/NodeInfoHelper.php | 10 +--------- Configuration/Settings.yaml | 2 +- .../TestDistribution/composer.json | 3 --- 5 files changed, 4 insertions(+), 41 deletions(-) diff --git a/Classes/Domain/Model/Feedback/Operations/ReloadContentOutOfBand.php b/Classes/Domain/Model/Feedback/Operations/ReloadContentOutOfBand.php index 83ae60847b..792fcd72f0 100644 --- a/Classes/Domain/Model/Feedback/Operations/ReloadContentOutOfBand.php +++ b/Classes/Domain/Model/Feedback/Operations/ReloadContentOutOfBand.php @@ -132,20 +132,7 @@ protected function renderContent(ControllerContext $controllerContext): string|R if ($this->nodeDomAddress) { $fusionView = new FusionView(); - - $fakeActionRequest = clone $controllerContext->getRequest(); - $fakeActionRequest->setControllerPackageKey('Neos.Neos'); - $fakeActionRequest->setControllerName('Frontend\\Node'); - $fakeActionRequest->setControllerActionName('edit'); - - $fakeControllerContext = new ControllerContext( - $fakeActionRequest, - $controllerContext->getResponse(), - $controllerContext->getArguments(), - $controllerContext->getUriBuilder(), - ); - - $fusionView->setControllerContext($fakeControllerContext); + $fusionView->setControllerContext($controllerContext); $fusionView->assign('value', $this->node); $fusionView->setFusionPath($this->nodeDomAddress->getFusionPathForContentRendering()); diff --git a/Classes/Domain/Model/Feedback/Operations/RenderContentOutOfBand.php b/Classes/Domain/Model/Feedback/Operations/RenderContentOutOfBand.php index f35e488232..c3f9539372 100644 --- a/Classes/Domain/Model/Feedback/Operations/RenderContentOutOfBand.php +++ b/Classes/Domain/Model/Feedback/Operations/RenderContentOutOfBand.php @@ -178,20 +178,7 @@ protected function renderContent(ControllerContext $controllerContext): string|R $parentDomAddress = $this->getParentDomAddress(); if ($parentDomAddress) { $fusionView = new FusionView(); - - $fakeActionRequest = clone $controllerContext->getRequest(); - $fakeActionRequest->setControllerPackageKey('Neos.Neos'); - $fakeActionRequest->setControllerName('Frontend\\Node'); - $fakeActionRequest->setControllerActionName('edit'); - - $fakeControllerContext = new ControllerContext( - $fakeActionRequest, - $controllerContext->getResponse(), - $controllerContext->getArguments(), - $controllerContext->getUriBuilder(), - ); - - $fusionView->setControllerContext($fakeControllerContext); + $fusionView->setControllerContext($controllerContext); $fusionView->assign('value', $parentNode); $fusionView->setFusionPath($parentDomAddress->getFusionPath()); diff --git a/Classes/Fusion/Helper/NodeInfoHelper.php b/Classes/Fusion/Helper/NodeInfoHelper.php index f5cdfbabeb..99242bd3de 100644 --- a/Classes/Fusion/Helper/NodeInfoHelper.php +++ b/Classes/Fusion/Helper/NodeInfoHelper.php @@ -211,7 +211,7 @@ protected function getUriInformation(Node $node, ControllerContext $controllerCo if (!$node->nodeType->isOfType($this->documentNodeTypeRole)) { return $nodeInfo; } - $nodeInfo['uri'] = $this->editUri($node, $controllerContext); + $nodeInfo['uri'] = $this->previewUri($node, $controllerContext); return $nodeInfo; } @@ -442,14 +442,6 @@ public function uri(Node|NodeAddress $nodeAddress, ControllerContext $controller return (string)NodeUriBuilder::fromRequest($controllerContext->getRequest())->uriFor($nodeAddress); } - public function editUri(Node $node, ControllerContext $controllerContext): string - { - $contentRepository = $this->contentRepositoryRegistry->get($node->subgraphIdentity->contentRepositoryId); - $nodeAddressFactory = NodeAddressFactory::create($contentRepository); - $nodeAddress = $nodeAddressFactory->createFromNode($node); - return (string)NodeUriBuilder::fromRequest($controllerContext->getRequest())->editUriFor($nodeAddress); - } - public function previewUri(Node $node, ControllerContext $controllerContext): string { $contentRepository = $this->contentRepositoryRegistry->get($node->subgraphIdentity->contentRepositoryId); diff --git a/Configuration/Settings.yaml b/Configuration/Settings.yaml index 64f4910097..7e7ee51eaf 100644 --- a/Configuration/Settings.yaml +++ b/Configuration/Settings.yaml @@ -137,7 +137,7 @@ Neos: personalWorkspace: '${Neos.Ui.Workspace.getPersonalWorkspace(contentRepositoryId)}' ui: contentCanvas: - src: '${Neos.Ui.NodeInfo.editUri(documentNode, controllerContext)}' + src: '${Neos.Ui.NodeInfo.uri(documentNode, controllerContext)}' backgroundColor: '${Configuration.setting(''Neos.Neos.Ui.contentCanvas.backgroundColor'')}' debugMode: false editPreviewMode: '${q(user).property("preferences.preferences")["contentEditing.editPreviewMode"] || Configuration.setting(''Neos.Neos.userInterface.defaultEditPreviewMode'')}' diff --git a/Tests/IntegrationTests/TestDistribution/composer.json b/Tests/IntegrationTests/TestDistribution/composer.json index 7c3dd2911f..20704ec76d 100644 --- a/Tests/IntegrationTests/TestDistribution/composer.json +++ b/Tests/IntegrationTests/TestDistribution/composer.json @@ -32,9 +32,6 @@ }, "extra": { "patches": { - "neos/neos-development-collection": { - "FEATURE: Edit preview mode support for Neos 9": "https://github.com/neos/neos-development-collection/pull/4067.patch" - } } }, "repositories": {