diff --git a/Neos.Neos/Classes/FrontendRouting/EventSourcedFrontendNodeRoutePartHandler.php b/Neos.Neos/Classes/FrontendRouting/EventSourcedFrontendNodeRoutePartHandler.php index 56f414cbf53..d2d592f61fa 100644 --- a/Neos.Neos/Classes/FrontendRouting/EventSourcedFrontendNodeRoutePartHandler.php +++ b/Neos.Neos/Classes/FrontendRouting/EventSourcedFrontendNodeRoutePartHandler.php @@ -34,6 +34,7 @@ use Neos\Neos\FrontendRouting\DimensionResolution\DelegatingResolver; use Neos\Neos\FrontendRouting\DimensionResolution\RequestToDimensionSpacePointContext; use Neos\Neos\FrontendRouting\DimensionResolution\DimensionResolverInterface; +use Neos\Neos\FrontendRouting\SiteDetection\SiteDetectionFailedException; use Neos\Neos\FrontendRouting\SiteDetection\SiteDetectionMiddleware; use Neos\Neos\FrontendRouting\SiteDetection\SiteDetectionResult; use Psr\Http\Message\UriInterface; @@ -175,7 +176,11 @@ public function matchWithParameters(&$requestPath, RouteParameters $parameters) return false; } - $siteDetectionResult = SiteDetectionResult::fromRouteParameters($parameters); + try { + $siteDetectionResult = SiteDetectionResult::fromRouteParameters($parameters); + } catch (SiteDetectionFailedException) { + return false; + } $resolvedSite = $this->siteRepository->findOneByNodeName($siteDetectionResult->siteNodeName); if ($resolvedSite === null) { @@ -196,7 +201,6 @@ public function matchWithParameters(&$requestPath, RouteParameters $parameters) // TODO validate dsp == complete (ContentDimensionZookeeper::getAllowedDimensionSubspace()->contains()...) // if incomplete -> no match + log - $siteDetectionResult = SiteDetectionResult::fromRouteParameters($parameters); $contentRepository = $this->contentRepositoryRegistry->get($siteDetectionResult->contentRepositoryId); try { diff --git a/Neos.Neos/Classes/Service/EditorContentStreamZookeeper.php b/Neos.Neos/Classes/Service/EditorContentStreamZookeeper.php index 2d1095bfe41..8ee55645c69 100644 --- a/Neos.Neos/Classes/Service/EditorContentStreamZookeeper.php +++ b/Neos.Neos/Classes/Service/EditorContentStreamZookeeper.php @@ -34,6 +34,7 @@ use Neos\Flow\Security\Policy\Role; use Neos\Neos\Domain\Model\User; use Neos\Neos\Domain\Service\WorkspaceNameBuilder; +use Neos\Neos\FrontendRouting\SiteDetection\SiteDetectionFailedException; use Neos\Neos\FrontendRouting\SiteDetection\SiteDetectionResult; use Neos\Party\Domain\Service\PartyService; @@ -95,7 +96,11 @@ public function relayEditorAuthentication(Authentication\TokenInterface $token): // we might be in testing context return; } - $siteDetectionResult = SiteDetectionResult::fromRequest($requestHandler->getHttpRequest()); + try { + $siteDetectionResult = SiteDetectionResult::fromRequest($requestHandler->getHttpRequest()); + } catch (SiteDetectionFailedException) { + return; + } $contentRepository = $this->contentRepositoryRegistry->get($siteDetectionResult->contentRepositoryId); $isEditor = false; @@ -131,8 +136,10 @@ public function relayEditorAuthentication(Authentication\TokenInterface $token): return; } - /** @var Workspace $baseWorkspace */ $baseWorkspace = $contentRepository->getWorkspaceFinder()->findOneByName(WorkspaceName::forLive()); + if (!$baseWorkspace) { + return; + } $editorsNewContentStreamId = ContentStreamId::create(); $contentRepository->handle( CreateWorkspace::create(