+
Skip to content

Conversation

vidarl
Copy link
Contributor

@vidarl vidarl commented Jun 5, 2025

🎫 Issue IBX-10116

Description:

Decorations of the fragment renders are not available for the ibexa_render() renderers (Ibexa\Core\MVC\Symfony\Templating\RenderLocationStrategy). This is because all renders are tagged kernel.fragment_renderer, both the original services, and the decorating ones! As the renders are stored in a hash array, the original services overwrites the decorating ones.

The result is that for instance the siteaccess is not serialized in esi calls when using ibexa_render() ( but it is if using render_esi(Controller())

This PR uses same approach as https://github.com/symfony/http-kernel/blob/v5.4.48/DependencyInjection/LazyLoadingFragmentHandler.php#L44-L47

For QA:

See ticket for How-to-reproduce instructions

Documentation:

Copy link

sonarqubecloud bot commented Jun 5, 2025

@vidarl vidarl requested a review from a team June 5, 2025 12:56
@ezrobot ezrobot requested review from Steveb-p, ViniTou, adamwojs, alongosz, barw4, ciastektk, konradoboza, mikadamczyk, tbialcz and wiewiurdp and removed request for a team June 5, 2025 12:56
Copy link
Member

@alongosz alongosz left a comment

Choose a reason for hiding this comment

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

TBH it's rather unexpected that a decorated service doesn't fully hide the original one when it comes to tags, but that's probably by design.

What worries me is how certain are we that the services order is going to be always the same for every projects' container? Does it depend on the bundle order in config/bundles.php?

@vidarl
Copy link
Contributor Author

vidarl commented Jul 7, 2025

TBH it's rather unexpected that a decorated service doesn't fully hide the original one when it comes to tags, but that's probably by design.

What worries me is how certain are we that the services order is going to be always the same for every projects' container? Does it depend on the bundle order in config/bundles.php?

No, just tested by putting Ibexa\Bundle\PageBuilder\IbexaPageBuilderBundle::class on top of bundels.php but order remains unchanged for ESI renders

You did see my comment that it is also done like this in Symfony, right? https://github.com/symfony/http-kernel/blob/v5.4.48/DependencyInjection/LazyLoadingFragmentHandler.php#L44-L47

@alongosz

@vidarl vidarl requested a review from alongosz July 7, 2025 13:04
@alongosz alongosz changed the title IBX-10116 ibexa_render() does not use decorated fragment renders IBX-10116: Fixed ibexa_render() not using decorated fragment renders Jul 7, 2025
@vidarl vidarl force-pushed the IBX-10116_ibexa_render_does_not_use_decorated_fragment_renders branch from 3a521f9 to 284fad4 Compare July 8, 2025 06:29
@micszo micszo self-assigned this Jul 28, 2025
@micszo micszo force-pushed the IBX-10116_ibexa_render_does_not_use_decorated_fragment_renders branch from 58b05b1 to 284fad4 Compare July 28, 2025 09:39
@micszo micszo force-pushed the IBX-10116_ibexa_render_does_not_use_decorated_fragment_renders branch from 284fad4 to 779ffdc Compare July 28, 2025 09:40
Copy link

Copy link
Contributor

@micszo micszo left a comment

Choose a reason for hiding this comment

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

Reproduced and retested with custom controller.

@micszo micszo removed their assignment Jul 28, 2025
@adamwojs adamwojs merged commit 7bbaf69 into 4.6 Jul 28, 2025
24 checks passed
@adamwojs adamwojs deleted the IBX-10116_ibexa_render_does_not_use_decorated_fragment_renders branch July 28, 2025 13:38
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.

8 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载