From 650f3ad9a7641ed3bc4d61d388e97cefc1ed6295 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 15 Sep 2026 08:02:04 +0000 Subject: [PATCH] Fix messenger worker crash by extending Shopware's TwigEnvironment Since shopware/shopware#19304 (Shopware 6.7.14.0), the twig service is tagged with kernel.reset and ServicesResetter calls reset() on it. TwigDecorator extended the plain Twig\Environment, which has no reset() method, so messenger workers crashed with an UndefinedMethodError after handling a message. Extending Shopware\Core\Framework\Adapter\Twig\TwigEnvironment (the class Shopware itself assigns to the twig service) restores the inherited reset() on 6.7.14+ and stays compatible with 6.6 and older 6.7 releases, where TwigEnvironment already exists but the kernel.reset tag is not registered. Fixes FriendsOfShopware/FroshDevelopmentHelper#85 Co-authored-by: Soner --- src/Component/Profiler/TwigDecorator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Component/Profiler/TwigDecorator.php b/src/Component/Profiler/TwigDecorator.php index 0adb21f..e9f59bf 100644 --- a/src/Component/Profiler/TwigDecorator.php +++ b/src/Component/Profiler/TwigDecorator.php @@ -2,10 +2,10 @@ namespace Frosh\DevelopmentHelper\Component\Profiler; -use Twig\Environment; +use Shopware\Core\Framework\Adapter\Twig\TwigEnvironment; use Twig\TemplateWrapper; -class TwigDecorator extends Environment +class TwigDecorator extends TwigEnvironment { private array $renders = [];