Skip to content

Commit

Permalink
TASK: Make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
mficzel committed May 24, 2023
1 parent da5a085 commit 5098a1e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function findDefault(): EditPreviewMode

public function findByName(string $name): EditPreviewMode
{
if (array_key_exists($name,$this->editPreviewModeConfigurations)) {
if (array_key_exists($name, $this->editPreviewModeConfigurations)) {
return EditPreviewMode::fromNameAndConfiguration($name, $this->editPreviewModeConfigurations[$name]);
}
throw new InvalidEditPreviewModeException(sprintf('"%s" is not a valid editPreviewMode', $name), 1683790077);
Expand Down
9 changes: 6 additions & 3 deletions Neos.Neos/Classes/FrontendRouting/NodeUriBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,16 @@ public function uriFor(NodeAddress $nodeAddress): UriInterface
{
if (!$nodeAddress->isInLiveWorkspace()) {
$request = $this->uriBuilder->getRequest();
if ($request->getControllerPackageKey() === 'Neos.Neos'
if (
$request->getControllerPackageKey() === 'Neos.Neos'
&& $request->getControllerName() === "Frontend\Node"
) {
if ($request->getControllerActionName() == 'edit') {
return $this->editUriFor($nodeAddress, $request->hasArgument('editPreviewMode') ? $request->getArgument('editPreviewMode') : null);
$editPreviewModeArgument = $request->hasArgument('editPreviewMode') ? $request->getArgument('editPreviewMode') : null;
return $this->editUriFor($nodeAddress, is_string($editPreviewModeArgument) ? $editPreviewModeArgument : null);
} elseif ($request->getControllerActionName() == 'preview') {
return $this->previewUriFor($nodeAddress, $request->hasArgument('editPreviewMode') ? $request->getArgument('editPreviewMode') : null);
$editPreviewModeArgument = $request->hasArgument('editPreviewMode') ? $request->getArgument('editPreviewMode') : null;
return $this->previewUriFor($nodeAddress, is_string($editPreviewModeArgument) ? $editPreviewModeArgument : null);
}
}

Expand Down
5 changes: 3 additions & 2 deletions Neos.Neos/Classes/Fusion/Helper/BackendHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ public function isPreviewMode(ActionRequest $request): bool

public function editPreviewModeCacheIdentifier(ActionRequest $request): string
{
if ($request->getControllerPackageKey() === 'Neos.Neos'
if (
$request->getControllerPackageKey() === 'Neos.Neos'
&& $request->getControllerName() === "Frontend\Node"
&& ($request->getControllerActionName() === 'edit' || $request->getControllerActionName() === 'preview')
) {
return $request->getControllerActionName() . ($request->hasArgument('editPreviewMode') ? ':' . $request->getArgument('editPreviewMode') : '');
return $request->getControllerActionName() . ($request->hasArgument('editPreviewMode') ? (':' . $request->getArgument('editPreviewMode')) : '');
} else {
return "";
}
Expand Down
5 changes: 3 additions & 2 deletions Neos.Neos/Classes/Service/LinkingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,13 @@ public function createNodeUri(
$uriBuilder = clone $controllerContext->getUriBuilder();
$uriBuilder->setRequest($request);

if ($request->getControllerPackageKey() === 'Neos.Neos'
if (
$request->getControllerPackageKey() === 'Neos.Neos'
&& $request->getControllerName() === "Frontend\Node"
&& in_array($request->getControllerActionName(), ['edit', 'preview'])
) {
$action = $request->getControllerActionName();
if ( $request->hasArgument('editPreviewMode')) {
if ($request->hasArgument('editPreviewMode')) {
$arguments['editPreviewMode'] = $request->getArgument('editPreviewMode');
}
} else {
Expand Down

0 comments on commit 5098a1e

Please sign in to comment.