Skip to content

BUGFIX: Dont crash if no site exists#3930

Open
mhsdesign wants to merge 1 commit intoneos:9.0from
mhsdesign:bugfix/dont-crash-if-no-site-exists
Open

BUGFIX: Dont crash if no site exists#3930
mhsdesign wants to merge 1 commit intoneos:9.0from
mhsdesign:bugfix/dont-crash-if-no-site-exists

Conversation

@mhsdesign
Copy link
Copy Markdown
Member

What I did

How I did it

How to verify it

@github-actions github-actions bot added Bug Label to mark the change as bugfix 9.0 labels Mar 26, 2025
@Sebobo Sebobo requested a review from Copilot April 1, 2025 20:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

Files not reviewed (1)
  • Classes/Infrastructure/Neos/MenuProvider.php: Language not supported

@@ -75,13 +75,13 @@ private function buildChildrenForSites(ControllerContext $controllerContext): ar

$result = [];
foreach ($sitesForMenu as $index => $site) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the array even contain an incomplete item?

@Sebobo
Copy link
Copy Markdown
Member

Sebobo commented Mar 24, 2026

@mhsdesign I wanted to reproduce what this fixes, as I didn't unterstand how the array could have a site without the necessary fields. But when I deactivate the last site I get the following exception instead:

Current site and content repository could not be extracted from the Request.
The SiteDetectionMiddleware was not able to determine the site!

Exception Code	1699459565
Exception Type	Neos\Neos\FrontendRouting\SiteDetection\SiteDetectionFailedException
Thrown in File	Packages/Neos/Neos.Neos/Classes/FrontendRouting/SiteDetection/SiteDetectionResult.php
Line	68

Which is of course also not optimal, so when the site detection fails, we should redirect to $something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

9.0 Bug Label to mark the change as bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants