From 5e3f5a2f78364192324268065cb818f58322c353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Wr=C3=B3blewski?= Date: Fri, 22 Mar 2024 13:24:32 +0100 Subject: [PATCH] fix(#72): column header, value and action blocks using incorrect template when used with custom theme (#73) --- src/Resources/views/themes/base.html.twig | 6 +++--- src/Twig/DataTableExtension.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Resources/views/themes/base.html.twig b/src/Resources/views/themes/base.html.twig index 995fa356..e378391a 100755 --- a/src/Resources/views/themes/base.html.twig +++ b/src/Resources/views/themes/base.html.twig @@ -109,15 +109,15 @@ {% endblock %} {% block kreyu_data_table_column_header %} - {{ block(block_name, theme) }} + {{ block(block_name, block_theme) }} {% endblock %} {% block kreyu_data_table_column_value %} - {{ block(block_name, theme) }} + {{ block(block_name, block_theme) }} {% endblock %} {% block kreyu_data_table_action %} - {% if visible %}{{- block(block_name, theme) -}}{% endif %} + {% if visible %}{{- block(block_name, block_theme) -}}{% endif %} {% endblock %} {# Pagination #} diff --git a/src/Twig/DataTableExtension.php b/src/Twig/DataTableExtension.php index 3fdc3931..f3076ed2 100755 --- a/src/Twig/DataTableExtension.php +++ b/src/Twig/DataTableExtension.php @@ -350,8 +350,8 @@ private function getDecoratedViewContext(Environment $environment, ColumnHeaderV $wrapper = $environment->load($theme); if ($wrapper->hasBlock($blockName, $context)) { - $context['theme'] = $theme; $context['block_name'] = $blockName; + $context['block_theme'] = $theme; break 2; }