Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

!!!TASK: Remove legacy fluid custom error view options and migrate to viewOptions #2743

Conversation

mhsdesign
Copy link
Member

@mhsdesign mhsdesign commented Mar 16, 2022

resolves: #2742

Concerning the options of any custom error view:

Neos.Flow.error.exceptionHandler.renderingGroups.{exampleGroup}.options

removes with Flow8 the legacy way of passing these options to a fluid view:

  • templatePathAndFilename
  • layoutRootPath
  • partialRootPath
  • format

(those were fluid only and not set via $view->setOption($option, $value) but set with ObjectAccess::setProperty directly on the view instance. link)

!!! Breaking

array{
    viewClassName: string,
    viewOptions: array,
    renderTechnicalDetails: bool,
    logException: bool,
    variables?: array,
-    templatePathAndFilename?: string,
-    layoutRootPath?: string,
-    partialRootPath?: string,
-    format?: string
}

one is advised to migrate those settings manually to the equivalent option in the subkey viewOptions or use the Flow migration Neos.Flow-20220318174300

options:
-  templatePathAndFilename: 'file'
-  layoutRootPath: 'path'
-  partialRootPath: 'path'
-  format: 'html'
+  viewOptions:
+    templatePathAndFilename: 'file'
+    layoutRootPaths: ['path']
+    partialRootPaths: ['path']

Concerning:
`Neos.Flow.error.exceptionHandler.renderingGroups.{exampleGroup}.options`

remove the legacy way of passing

* templatePathAndFilename
* layoutRootPath
* partialRootPath
* format

to a fluid view.

neos#2742
@albe albe changed the title !!! Remove legacy fluid custom error view options and migrate to viewOptions !!!TASK: Remove legacy fluid custom error view options and migrate to viewOptions Mar 18, 2022
Copy link
Member

@kdambekalns kdambekalns left a comment

Choose a reason for hiding this comment

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

Awesome… did we have a migration when this was deprecated? If not, what about adding one now?

@mhsdesign
Copy link
Member Author

mhsdesign commented Mar 18, 2022

taken from pr body:

How to test:

(Make sure youre on flow only - or comment out the neos.neos error view settings or also use neos/neos-development-collection#3637)

throw some of these at your favorite places and marvel at the great exceptions:

throw new DatabaseException();
throw new TargetNotFoundException(); // provokes a 404

@kdambekalns to be super honest - this has been missed to be deprecated for a long time so i deprecated it retroactive: #2731

what makes this ofc a super breaking change...

@kdambekalns
Copy link
Member

@kdambekalns to be super honest - this has been missed to be deprecated for a long time so i deprecated it retroactive: #2731

Oh, well. Fine with me, it was "legacy", at least. Still, a core migration should be easy enough, as this change is for a rather specific part of the settings. I hope. 😇

@mhsdesign
Copy link
Member Author

@kdambekalns voila: #2748

@mficzel
Copy link
Member

mficzel commented Mar 18, 2022

Why a separate pr for the migration?

@mhsdesign
Copy link
Member Author

mhsdesign commented Mar 18, 2022

@mficzel because everyone reviewed already ^^

.... hmm i could remove those also

@mficzel
Copy link
Member

mficzel commented Mar 18, 2022

If you think a new review is required you can do so in this pr. As Karsten asked for changes I would like to see them in here

related: neos#2742

automated way for:

```
options:
-  templatePathAndFilename: 'file'
-  layoutRootPath: 'path'
-  partialRootPath: 'path'
-  format: 'html'
+  viewOptions:
+    templatePathAndFilename: 'file'
+    layoutRootPaths: ['path']
+    partialRootPaths: ['path']
```
warn if if Neos.Flow.error.exceptionHandler.defaultRenderingOptions was used with legacy fluid view options
moving these options globally to the 'viewOptions' subkey would lead to that every view (not only fluid) will get them applied and not supported options view errors will occur.
Copy link
Member

@mficzel mficzel left a comment

Choose a reason for hiding this comment

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

Can confirm that the migration works for renderingGroups.xxx.options.
@kdambekalns can you take a second look at the migration before merging.

@mhsdesign
Copy link
Member Author

the neos part is merged now:
neos/neos-development-collection#3637

@kdambekalns kdambekalns merged commit 6f11a58 into neos:master Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

!!! Remove legacy fluid custom error view options
4 participants