-
Notifications
You must be signed in to change notification settings - Fork 29
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
IBX-6504: Gracefully handled URL generation in RoutingExtension
#389
IBX-6504: Gracefully handled URL generation in RoutingExtension
#389
Conversation
forcedLanguage
parameter in RoutingExtension
during previewforcedLanguageCode
parameter in RoutingExtension
during preview state
forcedLanguageCode
parameter in RoutingExtension
during preview stateRoutingExtension
eZ/Publish/Core/MVC/Symfony/Templating/Twig/Extension/RoutingExtension.php
Outdated
Show resolved
Hide resolved
Fix works when LP preview is empty (no block or no base lang). Otherwise exception persists but template changes (ezplatform-kernel/eZ/Bundle/EzPublishCoreBundle/Resources/views/pagelayout.html.twig -> ezplatform-page-fieldtype/src/bundle/Resources/views/default_layout.html.twig). |
@alongosz @konradoboza @Steveb-p @kisztof as @micszo noticed with the certain case the preview still wasn't able to be loaded. This is due to block rendering in a new language and loading old values if we are basing a new translation on an old translation. https://github.com/ezsystems/ezplatform-page-fieldtype/pull/251 + 124723a should handle this case |
This unblocked the mentioned flow. 🙂 |
@barw4 so if page is translated into many languages that would hit performance badly as all 30 translations would be loaded. I'm not sure if there's API issue here or we use it incorrectly, but that doesn't feel like a good direction performance wise. Not sure what to suggest without looking deeper into this. What is exactly the error there and what and where we're trying to load that we shouldn't? cc @ezsystems/php-dev-team |
@alongosz we have multiple calls like this (with To answer your question, this is basically the same case and comes down to loading Location, but now this is caused by blocks rendering https://github.com/ezsystems/ezplatform-page-fieldtype/blob/2.3/src/bundle/Resources/views/default_layout.html.twig#L8, specifically https://github.com/ezsystems/ezplatform-page-fieldtype/blob/2.3/src/lib/FragmentRenderer/BlockRenderOptionsFragmentRenderer.php#L121 and later https://github.com/ezsystems/ezplatform-page-fieldtype/blob/2.3/src/lib/FragmentRenderer/BlockRenderOptionsFragmentRenderer.php#L148. Situation is pretty much similar as |
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.
@alongosz we have multiple calls like this (with
Language::ALL
) throughout the whole codebase so I'm a bit surprised this has become a problem of performance just now. Especially, if this will only in reality affect PB's previews. In the same request, we are having the exact same calls from other packages as well (for example https://github.com/ezsystems/ezplatform-page-fieldtype/blob/2.3/src/lib/FieldType/Page/ParameterProvider.php#L116).To answer your question, this is basically the same case and comes down to loading Location, but now this is caused by blocks rendering https://github.com/ezsystems/ezplatform-page-fieldtype/blob/2.3/src/bundle/Resources/views/default_layout.html.twig#L8, specifically https://github.com/ezsystems/ezplatform-page-fieldtype/blob/2.3/src/lib/FragmentRenderer/BlockRenderOptionsFragmentRenderer.php#L121 and later https://github.com/ezsystems/ezplatform-page-fieldtype/blob/2.3/src/lib/FragmentRenderer/BlockRenderOptionsFragmentRenderer.php#L148. Situation is pretty much similar as
ez_path
- we cannot load Location in given Site Access whenalwaysAvailable
flag isfalse
without an error.
I'm not fully convinced by "we're already doing it like that" argument, however maybe it's fine for now if @micszo tries to benchmark it a bit with e.g. content item with 30 translations? AFAIR test-fixtures already contain a lot of languages, creating such content might be a bit time consuming, so maybe some sort of command to loop over languages and create translations? ;)
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Tested the flow by adding 30 translations to a Landing page with simple non-empty preview. Did not observe any significant increase in time when editing, previewing or publishing. |
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.
QA Approved on Ibexa Commerce 3.3.36-dev.
v3.3
Related PR: https://github.com/ezsystems/ezplatform-page-fieldtype/pull/251
Checklist:
$ composer fix-cs
).@ezsystems/engineering-team
).