diff --git a/Neos.Neos/Classes/Fusion/Helper/BackendHelper.php b/Neos.Neos/Classes/Fusion/Helper/BackendHelper.php index 53c5bd94779..b3dcf1aa0a2 100644 --- a/Neos.Neos/Classes/Fusion/Helper/BackendHelper.php +++ b/Neos.Neos/Classes/Fusion/Helper/BackendHelper.php @@ -35,8 +35,6 @@ class BackendHelper implements ProtectedContextAwareInterface */ public function interfaceLanguage(): string { - $currentUser = $this->userService->getBackendUser(); - assert($currentUser !== null, "No backend user"); return $this->userService->getInterfaceLanguage(); } diff --git a/Neos.Neos/Resources/Private/Fusion/Error/Root.fusion b/Neos.Neos/Resources/Private/Fusion/Error/Root.fusion index eb268cd26b6..8928db35a87 100644 --- a/Neos.Neos/Resources/Private/Fusion/Error/Root.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Error/Root.fusion @@ -1,4 +1,5 @@ include: resource://Neos.Fusion/Private/Fusion/Root.fusion +include: ../Prototypes/ErrorPage.fusion include: Views/*.fusion Neos.Fusion.FusionParserException = Neos.Neos:Error.View.FusionParserException { diff --git a/Neos.Neos/Resources/Private/Fusion/Error/Views/FusionParserException.fusion b/Neos.Neos/Resources/Private/Fusion/Error/Views/FusionParserException.fusion index 51ffb9cd382..39cd4982755 100644 --- a/Neos.Neos/Resources/Private/Fusion/Error/Views/FusionParserException.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Error/Views/FusionParserException.fusion @@ -5,7 +5,7 @@ prototype(Neos.Neos:Error.View.FusionParserException) < prototype(Neos.Fusion:Co flowPathRoot = '' renderer = afx` - +

{String.htmlspecialchars(props.exception.headingMessagePart)}

@@ -24,6 +24,6 @@ prototype(Neos.Neos:Error.View.FusionParserException) < prototype(Neos.Fusion:Co
-
+ ` } diff --git a/Neos.Neos/Resources/Private/Fusion/ErrorCase.fusion b/Neos.Neos/Resources/Private/Fusion/ErrorCase.fusion index b5bc4aa1111..83f191b2043 100644 --- a/Neos.Neos/Resources/Private/Fusion/ErrorCase.fusion +++ b/Neos.Neos/Resources/Private/Fusion/ErrorCase.fusion @@ -10,10 +10,7 @@ error = Neos.Fusion:Case { default { @position = 'end 9999' condition = true - renderer = Neos.Fusion:Template { - templatePath = 'resource://Neos.Neos/Private/Templates/Error/Index.html' - layoutRootPath = 'resource://Neos.Neos/Private/Layouts/' - + renderer = Neos.Neos:DefaultExceptionRenderer { exception = ${exception} renderingOptions = ${renderingOptions} statusCode = ${statusCode} @@ -22,3 +19,29 @@ error = Neos.Fusion:Case { } } } + +/** @internal */ +prototype(Neos.Neos:DefaultExceptionRenderer) < prototype(Neos.Fusion:Component) { + /** @var exception \Exception */ + exception = null + renderingOptions = null + + renderer = afx` + + +
+
+
+ +
+

{Translation.id('error.exception.' + props.renderingOptions.renderingGroup + '.title').package('Neos.Neos').locale(Neos.Backend.interfaceLanguage()).translate()}

+
+

+ {String.nl2br(Translation.id('error.exception.' + props.renderingOptions.renderingGroup + '.description').package('Neos.Neos').locale(Neos.Backend.interfaceLanguage()).translate())} +

+

#{props.exception.code}: {props.exception.message}

+
+ +
+ ` +} diff --git a/Neos.Neos/Resources/Private/Fusion/Error/Views/Page.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/ErrorPage.fusion similarity index 90% rename from Neos.Neos/Resources/Private/Fusion/Error/Views/Page.fusion rename to Neos.Neos/Resources/Private/Fusion/Prototypes/ErrorPage.fusion index 58c2788735c..bfeaf3e6924 100644 --- a/Neos.Neos/Resources/Private/Fusion/Error/Views/Page.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/ErrorPage.fusion @@ -1,4 +1,8 @@ -prototype(Neos.Neos:Error.View.Page) < prototype(Neos.Fusion:Component) { +/** + * Only for internal use! + * @internal + */ +prototype(Neos.Neos:ErrorPage) < prototype(Neos.Fusion:Component) { title = '' content = '' diff --git a/Neos.Neos/Resources/Private/Templates/Error/Index.html b/Neos.Neos/Resources/Private/Templates/Error/Index.html deleted file mode 100755 index b78250efe90..00000000000 --- a/Neos.Neos/Resources/Private/Templates/Error/Index.html +++ /dev/null @@ -1,28 +0,0 @@ -{namespace neos=Neos\Neos\ViewHelpers} - - - - Neos Error - - - - - -
-
-
- -
-

{neos:backend.translate(id: 'error.exception.{renderingOptions.renderingGroup}.title', package: 'Neos.Neos')}

-
-

{neos:backend.translate(id: 'error.exception.{renderingOptions.renderingGroup}.description', package: 'Neos.Neos') -> f:format.nl2br()}

- -

#{exception.code}: {exception.message}

-
- -

{neos:backend.translate(id: 'error.exception.{renderingOptions.renderingGroup}.setupMessage', package: 'Neos.Neos')}

-

{neos:backend.translate(id: 'error.exception.goToSetup', package: 'Neos.Neos')}

-
-
- -