From 6bdea6555d0a93a4a86253af1c5dfc86d0e3e98c Mon Sep 17 00:00:00 2001 From: Andrej Koelewijn Date: Thu, 16 Apr 2026 05:39:48 +0000 Subject: [PATCH] fix: skip Attribute fallback for custom-content datagrid columns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #202 added a sugar that falls back to the column's name when no explicit Attribute is given. For custom-content columns (those with an action-button body and no attribute binding), this caused CE1613 "attribute no longer exists" because names like 'colActions' don't resolve to real attributes. Skip the sugar when the column has child widgets — those columns don't bind to an attribute. Fixes the 03-page-examples.mdl integration test regression. --- mdl/executor/cmd_pages_builder_v3_widgets.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mdl/executor/cmd_pages_builder_v3_widgets.go b/mdl/executor/cmd_pages_builder_v3_widgets.go index 344bc0aa5..db026dd56 100644 --- a/mdl/executor/cmd_pages_builder_v3_widgets.go +++ b/mdl/executor/cmd_pages_builder_v3_widgets.go @@ -128,10 +128,9 @@ func (pb *pageBuilder) buildDataGridV3(w *ast.WidgetV3) (*pages.CustomWidget, er attr := child.GetAttribute() // Sugar: when no explicit Attribute: property is given, fall back to // the column's name. This lets `COLUMN Sku (Caption: 'SKU')` work - // without repeating `Attribute: Sku`. If the name starts with a - // lowercase prefix like "col" (convention for decoration), it won't - // resolve to a real attribute — and mx check will flag it later. - if attr == "" && child.Name != "" { + // without repeating `Attribute: Sku`. Skip for custom-content columns + // (those with a body of child widgets), which don't bind to an attribute. + if attr == "" && child.Name != "" && len(child.Children) == 0 { attr = child.Name } col := ast.DataGridColumnDef{