Skip to content

Commit 8ae45df

Browse files
akoclaude
andcommitted
fix: only auto-convert bare attribute names to toString()
The toString() auto-conversion should only apply to bare attribute names in DataView context (e.g., "TotalOrders"), not to $param.Attr references (e.g., "$order.OrderDate") which are resolved via SourceVariable/AttributeRef and handled correctly by Mendix. Converting $param.Attr patterns produced invalid expressions like toString($currentObject/$order.OrderDate) causing CE0117 errors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b03fa6a commit 8ae45df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mdl/executor/cmd_pages_builder_v3.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,8 +1188,10 @@ func (pb *pageBuilder) resolveTemplateAttributePathFull(attrRef string, param *p
11881188

11891189
// For other patterns, resolve and check type
11901190
resolved := pb.resolveTemplateAttributePath(attrRef)
1191-
if pb.isNonStringAttribute(resolved) {
1192-
// Convert to toString() expression for non-String attributes
1191+
if !strings.HasPrefix(attrRef, "$") && pb.isNonStringAttribute(resolved) {
1192+
// Convert bare attribute names to toString() for non-String types.
1193+
// Only for bare names (e.g., "TotalOrders") in DataView context,
1194+
// not for $param.Attr references which are resolved via SourceVariable.
11931195
param.Expression = "toString($currentObject/" + attrRef + ")"
11941196
return
11951197
}

0 commit comments

Comments
 (0)