Skip to content

Commit

Permalink
Merge pull request #4598 from neos/task/removeFluidRenderingForFusion…
Browse files Browse the repository at this point in the history
…ErrorExceptionView

TASK: Remove fluid error view Neos.Neos/Private/Templates/Error/Index.html
  • Loading branch information
ahaeslich authored Oct 16, 2023
2 parents 4d4538e + c9fd684 commit 6b11cc7
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 37 deletions.
2 changes: 0 additions & 2 deletions Neos.Neos/Classes/Fusion/Helper/BackendHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
1 change: 1 addition & 0 deletions Neos.Neos/Resources/Private/Fusion/Error/Root.fusion
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ prototype(Neos.Neos:Error.View.FusionParserException) < prototype(Neos.Fusion:Co
flowPathRoot = ''

renderer = afx`
<Neos.Neos:Error.View.Page title='Exception while parsing Fusion'>
<Neos.Neos:ErrorPage title='Exception while parsing Fusion'>
<body class='neos'>
<div class='neos-error-screen'>
<h3>{String.htmlspecialchars(props.exception.headingMessagePart)}</h3>
Expand All @@ -24,6 +24,6 @@ prototype(Neos.Neos:Error.View.FusionParserException) < prototype(Neos.Fusion:Co
</details>
</div>
</body>
</Neos.Neos:Error.View.Page>
</Neos.Neos:ErrorPage>
`
}
31 changes: 27 additions & 4 deletions Neos.Neos/Resources/Private/Fusion/ErrorCase.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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`
<Neos.Neos:ErrorPage title='Neos Error'>
<body class="neos">
<div class="neos-error-screen">
<div class="neos-message-header">
<div class="neos-message-icon">
<i class="fas fa-exclamation-triangle"></i>
</div>
<h1>{Translation.id('error.exception.' + props.renderingOptions.renderingGroup + '.title').package('Neos.Neos').locale(Neos.Backend.interfaceLanguage()).translate()}</h1>
</div>
<p>
{String.nl2br(Translation.id('error.exception.' + props.renderingOptions.renderingGroup + '.description').package('Neos.Neos').locale(Neos.Backend.interfaceLanguage()).translate())}
</p>
<p @if={props.renderingOptions.renderTechnicalDetails} class="technical-details">#{props.exception.code}: {props.exception.message}</p>
</div>
</body>
</Neos.Neos:ErrorPage>
`
}
Original file line number Diff line number Diff line change
@@ -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 = ''

Expand Down
28 changes: 0 additions & 28 deletions Neos.Neos/Resources/Private/Templates/Error/Index.html

This file was deleted.

0 comments on commit 6b11cc7

Please sign in to comment.