From 5bc46670b0a736e36b08078277b3428df287ae68 Mon Sep 17 00:00:00 2001 From: Mathieu Santostefano Date: Tue, 1 Oct 2024 16:48:58 +0200 Subject: [PATCH] fix(twig): Handle preview page of SyliusCmsPagePlugin render --- src/Twig/RichEditorExtension.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Twig/RichEditorExtension.php b/src/Twig/RichEditorExtension.php index 9f140bc1..885b3cc7 100644 --- a/src/Twig/RichEditorExtension.php +++ b/src/Twig/RichEditorExtension.php @@ -292,6 +292,11 @@ private function isAdmin(array $context): bool return false; } + // If we are on the SyliusCmsPagePlugin preview page, we need to load Shop templates. + if ('monsieurbiz_cms_page_admin_page_preview' === $request->get('_route')) { + return false; + } + return self::ADMIN_FIREWALL_CONTEXT === $request->get('_firewall_context'); } }