Skip to content

Commit a15a39d

Browse files
akoclaude
andcommitted
fix: use Texts$Translation instead of Texts$LiteralText in opTextTemplate
Texts$LiteralText is not a valid Mendix storage type name. The correct type for text items inside Texts$Text is Texts$Translation with a LanguageCode field. Also fix empty Parameters version marker (int32(3) for empty, not int32(2)). Fixes TypeCacheUnknownTypeException when opening projects with Image widgets that had text template values set via the pluggable engine. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent dc1bb46 commit a15a39d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

mdl/executor/widget_engine.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,16 @@ func setTextTemplateValue(val bson.D, text string) bson.D {
236236
{Key: "$Type", Value: "Texts$Text"},
237237
{Key: "Items", Value: bson.A{int32(3)}},
238238
}},
239-
{Key: "Parameters", Value: bson.A{int32(2)}},
239+
{Key: "Parameters", Value: bson.A{int32(3)}},
240240
{Key: "Template", Value: bson.D{
241241
{Key: "$ID", Value: mpr.IDToBsonBinary(mpr.GenerateID())},
242242
{Key: "$Type", Value: "Texts$Text"},
243243
{Key: "Items", Value: bson.A{
244244
int32(3),
245245
bson.D{
246246
{Key: "$ID", Value: mpr.IDToBsonBinary(mpr.GenerateID())},
247-
{Key: "$Type", Value: "Texts$LiteralText"},
247+
{Key: "$Type", Value: "Texts$Translation"},
248+
{Key: "LanguageCode", Value: "en_US"},
248249
{Key: "Text", Value: text},
249250
},
250251
}},
@@ -271,7 +272,8 @@ func updateTemplateText(tmpl bson.D, text string) bson.D {
271272
int32(3),
272273
bson.D{
273274
{Key: "$ID", Value: mpr.IDToBsonBinary(mpr.GenerateID())},
274-
{Key: "$Type", Value: "Texts$LiteralText"},
275+
{Key: "$Type", Value: "Texts$Translation"},
276+
{Key: "LanguageCode", Value: "en_US"},
275277
{Key: "Text", Value: text},
276278
},
277279
}})

0 commit comments

Comments
 (0)