!!! feat: Update for Neos 9#23
Open
paxuclus wants to merge 6 commits into
Open
Conversation
This removes the old yaml based configuration so only node based error pages can be used from now on
stephanschuler
approved these changes
Nov 4, 2024
# Conflicts: # Classes/Configuration/ErrorHandlerConfiguration.php # Classes/Configuration/NodeBasedConfiguration.php
NodeBasedConfiguration::getSiteNodes() silently found no error page configuration at all on installations with zero content dimensions configured, which is a valid and fairly common setup (single-locale sites). combineAllDimensionSpacePoints() only ever produced a result by combining pairs of dimension values, so with no dimensions the combination loop never ran and returned an empty set; the outer lookup then never yielded a single site node, and getConfiguration() came back completely empty with no error/warning of any kind (not even the --verbose per-site output). Also fixes two issues found while getting the zero-dimension case to actually run end-to-end: - VisibilityConstraints::frontend() doesn't exist on this neos/contentrepository-core version; replaced with the documented Neos-specific equivalent (NeosVisibilityConstraints::excludeRemoved() merged with ::excludeDisabled()). - findChildNodes() against the shared "Neos.Neos:Sites" root returns every site's node, not just the current one being iterated in the outer loop, so with N sites this reprocessed (and re-fetched/re-saved the error page for) each site N times over. Filtered to the matching child node name.
…sion NodeAggregate::getNodeByCoveredDimensionSpacePoint() doesn't exist on this neos/contentrepository-core version, which made errorpage:generate fail to resolve every configured error page's source URI. Per NodeAggregate's own documented usage, look the node up by first resolving the occupied origin for the covered dimension space point.
There was a problem hiding this comment.
Pull request overview
This PR upgrades Netlogix.ErrorHandler for Neos 9, refactoring the error-page generation and resolution logic to use the Neos 9 Content Repository / FrontendRouting APIs and removing the legacy YAML-based error page configuration so that only node-based error pages are supported going forward.
Changes:
- Removed YAML-based error page configuration paths (docs + settings + related PHP classes).
- Refactored error page configuration discovery/resolution to Neos 9 APIs (ContentGraph, DimensionSpacePoint, FrontendRouting).
- Updated package requirements (PHP/Neos/Flow/Guzzle) and introduced a new
ActionRequestFactoryto build backend routing contexts.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Resources/Private/Fusion/Root.fusion | Adjusts Fusion case positioning for the error handler renderer. |
| README.md | Removes documentation for YAML-based configuration (node-based only). |
| Configuration/Settings.yaml | Removes the legacy pages setting scaffold. |
| composer.json | Bumps requirements for Neos 9 / Flow 9 and updates dependency constraints. |
| Classes/Service/ErrorPageResolver.php | Updates configuration lookup signature and logs throwables via ThrowableStorageInterface. |
| Classes/Service/DestinationResolver.php | Adjusts destination context calculation (notably dimensions). |
| Classes/Service/ControllerContextFactory.php | Removes legacy controller-context building for old routing/linking approach. |
| Classes/Service/ActionRequestFactory.php | New helper to build ActionRequest from SiteDetectionResult (Neos 9 routing). |
| Classes/Handler/ProductionExceptionHandler.php | Cleans up legacy compatibility comments and whitespace. |
| Classes/DataSource/ErrorPageView.php | Migrates data source node type to the Neos 9 ContentGraph Node and adapts configuration lookup. |
| Classes/Configuration/SettingsBasedConfiguration.php | Removes YAML/settings-based configuration implementation. |
| Classes/Configuration/NodeBasedConfiguration.php | Reworks node-based configuration discovery to ContentGraph and dimension-space handling. |
| Classes/Configuration/ErrorHandlerConfiguration.php | Refactors configuration matching to dimension-space resolution from the request. |
| Classes/Command/ErrorPageCommandController.php | Updates error page generation to Neos 9 routing + ContentGraph node lookup and URL building. |
Comments suppressed due to low confidence (1)
Classes/Configuration/ErrorHandlerConfiguration.php:72
- The docblock for findConfigurationForSite() is malformed (nested "/**") and still references $uri and dimensionPathSegment, which are no longer part of the implementation. This makes IDE/static-analysis hints misleading.
/**
*
* /**
* Find error page configuration by Site, Dimension (parsed in $uri) and status code.
* If no configuration is found that matches the parsed dimensionPathSegment, the first configuration
* for the Site and statusCode is used.
*
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+184
to
+188
| foreach ($contentDimensions as $contentDimension) { | ||
| assert($contentDimension instanceof ContentDimension); | ||
|
|
||
| foreach ($contentDimension->values as $contentDimensionValue) { | ||
| foreach ($contentDimensions as $otherContentDimension) { |
Comment on lines
+40
to
+41
| #[Flow\Inject] | ||
| protected CompilingEvaluator $eelEvaluator; |
Comment on lines
+26
to
+28
| $site = $this->siteRepository->findOneByNodeName($siteDetectionResult->siteNodeName); | ||
| $baseUri = new Uri((string)$site->getPrimaryDomain()); | ||
|
|
Comment on lines
+160
to
+165
| $nodeAggregate = $contentGraph->findNodeAggregateById(NodeAggregateId::fromString(substr($configuration['source'], 1))); | ||
| $dimensionSpacePoint = DimensionSpacePoint::fromJsonString(json_encode($configuration['dimensions'])); | ||
|
|
||
| $source = $nodeAggregate->getNodeByOccupiedDimensionSpacePoint( | ||
| $nodeAggregate->getOccupationByCovered($dimensionSpacePoint) | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This removes the old yaml based configuration so only node based error pages can be used from now on