Skip to content

Commit

Permalink
fix(#72): column header, value and action blocks using incorrect temp…
Browse files Browse the repository at this point in the history
…late when used with custom theme (#73)
  • Loading branch information
Kreyu authored Mar 22, 2024
1 parent 0d53e81 commit 5e3f5a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Resources/views/themes/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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 #}
Expand Down
2 changes: 1 addition & 1 deletion src/Twig/DataTableExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5e3f5a2

Please sign in to comment.