Skip to content

fix: skip Attribute fallback for custom-content datagrid columns#208

Merged
ako merged 1 commit intomainfrom
fix/column-actions-customcontent
Apr 16, 2026
Merged

fix: skip Attribute fallback for custom-content datagrid columns#208
ako merged 1 commit intomainfrom
fix/column-actions-customcontent

Conversation

@ako
Copy link
Copy Markdown
Collaborator

@ako ako commented Apr 16, 2026

Summary

PR #202 added a sugar that falls back to the column's name when no explicit Attribute: is given. That's nice for COLUMN Sku (Caption: 'SKU'), but for custom-content columns (those with an action-button body and no attribute binding), it caused:

[error] [CE1613] "The selected attribute 'PgTest.Product.colActions' no longer exists."

Because names like colActions don't resolve to real attributes.

Fix

Skip the sugar when the column has child widgets — those columns don't bind to an attribute.

if attr == "" && child.Name != "" && len(child.Children) == 0 {
    attr = child.Name
}

Test plan

  • go build ./...
  • go test ./mdl/executor/ (unit tests pass)
  • CI integration test: 03-page-examples.mdl should pass (the remaining main build failure)

Cases covered:

  • COLUMN Sku (Caption: 'SKU') — no attr, no children → falls back to "Sku" ✓ (unchanged)
  • COLUMN colActions (Caption: 'Actions') { ACTIONBUTTON ... } — no attr, has children → stays empty ✓ (fixed)
  • COLUMN colActions (Attribute: Name, ..., ShowContentAs: customContent) { ... } — explicit attr → unchanged ✓

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.
@github-actions
Copy link
Copy Markdown

AI Code Review

Critical Issues

None

Moderate Issues

None

Minor Issues

None

What Looks Good

  • The fix is minimal and targeted, addressing the exact issue described (Attribute fallback causing errors for custom-content columns).
  • The change correctly skips the fallback when columns have child widgets (custom-content columns), preserving the fallback for simple attribute-bound columns.
  • The PR author verified the build passes and unit tests pass, with a clear test plan covering the fixed cases.
  • No syntax changes were made, so full-stack consistency checks (grammar, AST, visitor, etc.) are not applicable.
  • The change follows existing code patterns and maintains backward compatibility for valid use cases.
  • No security risks, duplication, or scope creep introduced.

Recommendation

Approve the PR. The fix resolves the reported bug without adverse effects, and the author has completed appropriate validation steps. The pending CI integration test (03-page-examples.mdl) is expected to pass with this change, as noted in the test plan.


Automated review via OpenRouter (Nemotron Super 120B) — workflow source

@ako ako merged commit 02c09cd into main Apr 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant