From 6ca4b91e1e62ea852a7c745c66ecd605e7a11499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 19 Nov 2024 12:58:20 +0100 Subject: [PATCH] Refactor breadcrumb macro parameters in Workflow templates Updated the breadcrumb macro's parameters to accept `entity_workflow` directly instead of a context object. This change affects the index, list, and macro_breadcrumb templates, ensuring consistent parameter usage and improving readability. This avoid exploiting a bug which was solved in twig 3.15.0 --- .../Resources/views/Workflow/index.html.twig | 2 +- .../ChillMainBundle/Resources/views/Workflow/list.html.twig | 2 +- .../Resources/views/Workflow/macro_breadcrumb.html.twig | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/index.html.twig index 48f7ef361..f469e7f66 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/index.html.twig @@ -37,7 +37,7 @@

{{ handler.entityTitle(entity_workflow) }}

- {{ macro.breadcrumb({'entity_workflow': entity_workflow}) }} + {{ macro.breadcrumb(entity_workflow) }} {% if entity_workflow.isOnHoldAtCurrentStep %} {{ 'workflow.On hold'|trans }} {% endif %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/list.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/list.html.twig index 5dd6dc714..d9e86c3f4 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/list.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/list.html.twig @@ -68,7 +68,7 @@
- {{ macro.breadcrumb(l) }} + {{ macro.breadcrumb(l.entity_workflow) }} {% if l.entity_workflow.isOnHoldAtCurrentStep %} {{ 'workflow.On hold'|trans }} {% endif %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/macro_breadcrumb.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/macro_breadcrumb.html.twig index 6a1c66ae7..b0141aae7 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/macro_breadcrumb.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/macro_breadcrumb.html.twig @@ -52,10 +52,10 @@ {% endif %} {% endmacro %} -{% macro breadcrumb(_ctx) %} +{% macro breadcrumb(entity_workflow) %}