-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fix EZP-25960: Double layout using legacy /layout/set module and LegacyKernelController #59
Fix EZP-25960: Double layout using legacy /layout/set module and LegacyKernelController #59
Conversation
+1 |
…cyKernelController > https://jira.ez.no/browse/EZP-25960 When using `/layout/set` legacy module through `LegacyKernelController` having a module layout configured, result from legacy kernel is rendered using this module layout. However, when using `/layout/set`, you already define a layout in legacy stack (via `layout.ini`. Problem is that the result from `/layout/set` will be embedded in the configured module layout, which can give very unexpected results. Best example is that when you want to render XML, JSON or anything not HTML, you'll have the result embedded in some HTML layout.) This patch adds `_ezpublishLegacyLayoutSet` route which corresponds to `/layout/set` module, and ensures that if this route is used through legacy kernel, custom layout won't be used. This fixes the usual behabior of layout module.
30a6f8b
to
7caeb7c
Compare
@@ -26,3 +26,10 @@ _ezpublishLegacyRest: | |||
_controller: ezpublish_legacy.rest.controller:restAction | |||
requirements: | |||
path: .* | |||
|
|||
_ezpublishLegacyLayoutSet: | |||
path: /layout/set/{path} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this work with uri SA? is that what requirements
is about just below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this work with uri SA
Yes, as we override default router to use semanticPathinfo. So this will always work.
The requirements is just to allow /
for {path}
@andrerom Is this OK for you ? |
Any feedback please ? |
+1 The two others are out catching pokemons but should be back next week ;) |
+1 |
Thanks @lolautruche |
When using
/layout/set
legacy module throughLegacyKernelController
having a module layout configured, result from legacy kernel is rendered using this module layout.However, when using
/layout/set
, you already define a layout in legacy stack (vialayout.ini
. Problem is that the result from/layout/set
will be embedded in the configured module layout, which can give veryunexpected results.
Best example is that when you want to render XML, JSON or anything not HTML, you'll have the result embedded in some HTML layout.)
This patch adds
_ezpublishLegacyLayoutSet
route which corresponds to/layout/set
module, and ensures that if this route is used through legacy kernel, custom layout won't be used.This fixes the usual behavior of layout module.