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

"pimcore_placeholder()" Twig function is broken by "twig/twig" >= v3.9.0 #16973

Open
alesak opened this issue Apr 22, 2024 · 3 comments
Open
Labels

Comments

@alesak
Copy link
Contributor

alesak commented Apr 22, 2024

Pimcore version

10.6 or newer

Steps to reproduce

try to render attached twig document
placeholder-test.html.twig.txt

Actual Behavior

When rendered with twig v3.8.0 it correctly renders three times same section but when rendered with twig v3.9.0 or newer the part which should be captured is actually rendered and the three sections which should contain captured content are empty

Expected Behavior

same content should be rendered with both versions of "twig/twig"

@alesak alesak added the Bug label Apr 22, 2024
@jdreesen
Copy link
Contributor

That's because it uses rybakit/twig-deferred-extension, which hacks Twig to do its thing, and now it broke with the latest Twig update.

So you should stay on Twig <3.9 for now, like: #16958

@alesak
Copy link
Contributor Author

alesak commented Apr 22, 2024

I don't think it uses rybakit/twig-deferred-extension but rather similar technique using \ob_start() \ob_get_clean(); to capture the content and is now not working thanks to the "yield" output used in twig >= 3.9.0 instead print or echo....

@jdreesen
Copy link
Contributor

jdreesen commented Apr 22, 2024

You're right. This needs to be fixed on Pimcore's side. Maybe the new CaptureNode helps here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants