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

Fix EZP-25960: Double layout using legacy /layout/set module and LegacyKernelController #59

Merged
merged 1 commit into from
Jul 18, 2016

Conversation

lolautruche
Copy link
Contributor

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 behavior of layout module.

@bdunogier
Copy link
Member

+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.
@@ -26,3 +26,10 @@ _ezpublishLegacyRest:
_controller: ezpublish_legacy.rest.controller:restAction
requirements:
path: .*

_ezpublishLegacyLayoutSet:
path: /layout/set/{path}
Copy link
Contributor

@andrerom andrerom Jul 5, 2016

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?

Copy link
Contributor Author

@lolautruche lolautruche Jul 5, 2016

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}

@lolautruche
Copy link
Contributor Author

@andrerom Is this OK for you ?

@lolautruche
Copy link
Contributor Author

Any feedback please ?
@andrerom @bdunogier @yannickroger

@andrerom
Copy link
Contributor

+1

The two others are out catching pokemons but should be back next week ;)

@yannickroger
Copy link
Contributor

+1

@yannickroger yannickroger merged commit ba9e0f3 into ezsystems:master Jul 18, 2016
@yannickroger
Copy link
Contributor

Thanks @lolautruche

@lolautruche lolautruche deleted the fix/EZP-25960_LayoutSet branch July 19, 2016 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants