Skip to content

Commit dc02d4c

Browse files
akoclaude
andcommitted
fix: add AllowUpload field to WidgetValueType BSON (closes one CE0463 gap)
Refs: mendixlabs#541 (CE0463 — partial) Studio Pro 11.x emits an `AllowUpload` field on every CustomWidgets$WidgetValueType in widget BSON. Embedded templates (sdk/widgets/templates/mendix-11.6/*.json), the createDefaultValueType helper used by AugmentTemplate, and the serializeWidgetValueType writer function all omitted this field. Result: every pluggable widget mxcli writes carries a ValueType schema that's missing one field vs. what Mendix 11.x's runtime emits. Methodology — comparing Studio Pro's PgTest.DataGridExample reference page against an mxcli reproduction of the same MDL via `mxcli bson dump --compare`: Studio: 28 ValueType keys per WidgetValueType (316 instances on the page) Mxcli: 27 ValueType keys per WidgetValueType (87 instances) Only difference: AllowUpload (false on every Studio instance) Fix in three places: 1. sdk/widgets/templates/mendix-11.6/*.json — bulk added `"AllowUpload": false` to all 581 WidgetValueType instances across 30 embedded templates. 2. sdk/widgets/augment.go createDefaultValueType — adds AllowUpload to the map constructed for new property types added to a template via MPK augmentation. 3. sdk/mpr/writer_widgets_custom.go serializeWidgetValueType — adds AllowUpload to the bson.D the structured-data writer produces (non-RawType path). Verified post-fix: every WidgetValueType in mxcli output has AllowUpload (100/100 on the v0.10 fixture #31). Top-level and nested column ValueType key sets now match Studio Pro exactly. Limitation — CE0463 still fires on the v0.10 fixture's DataGrid widgets despite key sets matching. There's at least one more layer of drift not visible at the JSON-decoded BSON level — possibly array-marker types (BSON `[1,...]` vs `[2,...]` vs `[3,...]`), TypePointer cycles, or non-BSON-visible metadata that Studio Pro's "definition has changed" detector inspects. Follow-up investigation tracked in mendixlabs#541. Suggested next step: try `mx dump-mpr` against the project to see what authoritative metadata Mendix exposes about its WidgetValueType schema (per the unified registry proposal mendixlabs#529). If `mx dump-mpr` reveals additional fields or different array-marker patterns, that's the next gap to close. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 80821b8 commit dc02d4c

32 files changed

Lines changed: 588 additions & 5 deletions

sdk/mpr/writer_widgets_custom.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ func serializeWidgetValueType(id string, valueType string) bson.D {
323323
{Key: "ActionVariables", Value: bson.A{int32(2)}},
324324
{Key: "AllowedTypes", Value: bson.A{int32(1)}},
325325
{Key: "AllowNonPersistableEntities", Value: false},
326+
{Key: "AllowUpload", Value: false},
326327
{Key: "AssociationTypes", Value: bson.A{int32(1)}},
327328
{Key: "DataSourceProperty", Value: ""},
328329
{Key: "DefaultType", Value: "None"},

sdk/widgets/augment.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ func createDefaultValueType(vtID string, bsonType string, p mpk.PropertyDef) map
569569
"$Type": "CustomWidgets$WidgetValueType",
570570
"ActionVariables": []any{float64(2)},
571571
"AllowNonPersistableEntities": false,
572+
"AllowUpload": false,
572573
"AllowedTypes": []any{float64(1)},
573574
"AssociationTypes": []any{float64(1)},
574575
"DataSourceProperty": "",

sdk/widgets/templates/mendix-11.6/accessibilityhelper.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
1
3131
],
3232
"AllowNonPersistableEntities": false,
33+
"AllowUpload": false,
3334
"AssociationTypes": [
3435
1
3536
],
@@ -80,6 +81,7 @@
8081
1
8182
],
8283
"AllowNonPersistableEntities": false,
84+
"AllowUpload": false,
8385
"AssociationTypes": [
8486
1
8587
],
@@ -130,6 +132,7 @@
130132
1
131133
],
132134
"AllowNonPersistableEntities": false,
135+
"AllowUpload": false,
133136
"AssociationTypes": [
134137
1
135138
],
@@ -168,6 +171,7 @@
168171
1
169172
],
170173
"AllowNonPersistableEntities": false,
174+
"AllowUpload": false,
171175
"AssociationTypes": [
172176
1
173177
],
@@ -218,6 +222,7 @@
218222
1
219223
],
220224
"AllowNonPersistableEntities": false,
225+
"AllowUpload": false,
221226
"AssociationTypes": [
222227
1
223228
],
@@ -280,6 +285,7 @@
280285
1
281286
],
282287
"AllowNonPersistableEntities": false,
288+
"AllowUpload": false,
283289
"AssociationTypes": [
284290
1
285291
],
@@ -337,6 +343,7 @@
337343
1
338344
],
339345
"AllowNonPersistableEntities": false,
346+
"AllowUpload": false,
340347
"AssociationTypes": [
341348
1
342349
],
@@ -387,6 +394,7 @@
387394
1
388395
],
389396
"AllowNonPersistableEntities": false,
397+
"AllowUpload": false,
390398
"AssociationTypes": [
391399
1
392400
],

sdk/widgets/templates/mendix-11.6/accordion.json

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
1
3131
],
3232
"AllowNonPersistableEntities": false,
33+
"AllowUpload": false,
3334
"AssociationTypes": [
3435
1
3536
],
@@ -80,6 +81,7 @@
8081
1
8182
],
8283
"AllowNonPersistableEntities": false,
84+
"AllowUpload": false,
8385
"AssociationTypes": [
8486
1
8587
],
@@ -118,6 +120,7 @@
118120
1
119121
],
120122
"AllowNonPersistableEntities": false,
123+
"AllowUpload": false,
121124
"AssociationTypes": [
122125
1
123126
],
@@ -180,6 +183,7 @@
180183
1
181184
],
182185
"AllowNonPersistableEntities": false,
186+
"AllowUpload": false,
183187
"AssociationTypes": [
184188
1
185189
],
@@ -242,6 +246,7 @@
242246
1
243247
],
244248
"AllowNonPersistableEntities": false,
249+
"AllowUpload": false,
245250
"AssociationTypes": [
246251
1
247252
],
@@ -328,6 +333,7 @@
328333
1
329334
],
330335
"AllowNonPersistableEntities": false,
336+
"AllowUpload": false,
331337
"AssociationTypes": [
332338
1
333339
],
@@ -378,6 +384,7 @@
378384
1
379385
],
380386
"AllowNonPersistableEntities": false,
387+
"AllowUpload": false,
381388
"AssociationTypes": [
382389
1
383390
],
@@ -428,6 +435,7 @@
428435
1
429436
],
430437
"AllowNonPersistableEntities": false,
438+
"AllowUpload": false,
431439
"AssociationTypes": [
432440
1
433441
],
@@ -485,6 +493,7 @@
485493
1
486494
],
487495
"AllowNonPersistableEntities": false,
496+
"AllowUpload": false,
488497
"AssociationTypes": [
489498
1
490499
],
@@ -529,7 +538,7 @@
529538
"$Type": "CustomWidgets$WidgetPropertyType",
530539
"Caption": "Load content",
531540
"Category": "General",
532-
"Description": "This property determines when the widgets should be rendered and data is fetched. The “Always” option will always load the widgets regardless whether the group is expanded. The “When expanded option can reduce the initial (page) load time, but will increase the load time when expanding the group.",
541+
"Description": "This property determines when the widgets should be rendered and data is fetched. The \u201cAlways\u201d option will always load the widgets regardless whether the group is expanded. The \u201cWhen expanded\u201d option can reduce the initial (page) load time, but will increase the load time when expanding the group.",
533542
"IsDefault": false,
534543
"PropertyKey": "loadContent",
535544
"ValueType": {
@@ -542,6 +551,7 @@
542551
1
543552
],
544553
"AllowNonPersistableEntities": false,
554+
"AllowUpload": false,
545555
"AssociationTypes": [
546556
1
547557
],
@@ -604,6 +614,7 @@
604614
1
605615
],
606616
"AllowNonPersistableEntities": false,
617+
"AllowUpload": false,
607618
"AssociationTypes": [
608619
1
609620
],
@@ -672,6 +683,7 @@
672683
1
673684
],
674685
"AllowNonPersistableEntities": false,
686+
"AllowUpload": false,
675687
"AssociationTypes": [
676688
1
677689
],
@@ -730,6 +742,7 @@
730742
"Boolean"
731743
],
732744
"AllowNonPersistableEntities": false,
745+
"AllowUpload": false,
733746
"AssociationTypes": [
734747
1
735748
],
@@ -780,6 +793,7 @@
780793
1
781794
],
782795
"AllowNonPersistableEntities": false,
796+
"AllowUpload": false,
783797
"AssociationTypes": [
784798
1
785799
],
@@ -848,6 +862,7 @@
848862
1
849863
],
850864
"AllowNonPersistableEntities": false,
865+
"AllowUpload": false,
851866
"AssociationTypes": [
852867
1
853868
],
@@ -898,6 +913,7 @@
898913
1
899914
],
900915
"AllowNonPersistableEntities": false,
916+
"AllowUpload": false,
901917
"AssociationTypes": [
902918
1
903919
],
@@ -960,6 +976,7 @@
960976
1
961977
],
962978
"AllowNonPersistableEntities": false,
979+
"AllowUpload": false,
963980
"AssociationTypes": [
964981
1
965982
],
@@ -1010,6 +1027,7 @@
10101027
1
10111028
],
10121029
"AllowNonPersistableEntities": false,
1030+
"AllowUpload": false,
10131031
"AssociationTypes": [
10141032
1
10151033
],
@@ -1078,6 +1096,7 @@
10781096
1
10791097
],
10801098
"AllowNonPersistableEntities": false,
1099+
"AllowUpload": false,
10811100
"AssociationTypes": [
10821101
1
10831102
],
@@ -1128,6 +1147,7 @@
11281147
1
11291148
],
11301149
"AllowNonPersistableEntities": false,
1150+
"AllowUpload": false,
11311151
"AssociationTypes": [
11321152
1
11331153
],
@@ -1178,6 +1198,7 @@
11781198
1
11791199
],
11801200
"AllowNonPersistableEntities": false,
1201+
"AllowUpload": false,
11811202
"AssociationTypes": [
11821203
1
11831204
],
@@ -1228,6 +1249,7 @@
12281249
1
12291250
],
12301251
"AllowNonPersistableEntities": false,
1252+
"AllowUpload": false,
12311253
"AssociationTypes": [
12321254
1
12331255
],

0 commit comments

Comments
 (0)