From 904ba4362bf3dae185d4ceaa6a353624e39a72f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Fr=C3=A9mont?= Date: Mon, 23 Mar 2026 09:35:06 +0100 Subject: [PATCH] fix(bootstrap-admin-ui): Fix data table when using a resource without id --- .../shared/crud/index/content/grid/data_table.html.twig | 2 +- src/BootstrapAdminUi/templates/shared/helper/table.html.twig | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BootstrapAdminUi/templates/shared/crud/index/content/grid/data_table.html.twig b/src/BootstrapAdminUi/templates/shared/crud/index/content/grid/data_table.html.twig index cc7657f7..b4b93c14 100644 --- a/src/BootstrapAdminUi/templates/shared/crud/index/content/grid/data_table.html.twig +++ b/src/BootstrapAdminUi/templates/shared/crud/index/content/grid/data_table.html.twig @@ -1,7 +1,7 @@ {% import '@SyliusBootstrapAdminUi/shared/helper/table.html.twig' as table %} {% import '@SyliusBootstrapAdminUi/shared/helper/pagination.html.twig' as pagination %} -{% set resources = hookable_metadata.context.resources %} +{% set resources = resources|default(hookable_metadata.context.resources|default(null)) %} {% set data = resources.data|default([]) %} {% set definition = resources.definition|default(null) %} diff --git a/src/BootstrapAdminUi/templates/shared/helper/table.html.twig b/src/BootstrapAdminUi/templates/shared/helper/table.html.twig index 38683055..8bfbf15c 100644 --- a/src/BootstrapAdminUi/templates/shared/helper/table.html.twig +++ b/src/BootstrapAdminUi/templates/shared/helper/table.html.twig @@ -24,8 +24,8 @@ {% macro row(grid, definition, row) %} {% import '@SyliusBootstrapAdminUi/shared/helper/dropdown.html.twig' as dropdown %} - - {% if definition.actionGroups.bulk is defined and definition.getEnabledActions('bulk')|length > 0 %} + + {% if definition.actionGroups.bulk is defined and definition.getEnabledActions('bulk')|length > 0 and row.id is defined %} {% endif %} {% for field in definition.enabledFields|sylius_sort_by('position') %}