Commit dc02d4c
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
File tree
- sdk
- mpr
- widgets
- templates/mendix-11.6
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
| 326 | + | |
326 | 327 | | |
327 | 328 | | |
328 | 329 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
| 572 | + | |
572 | 573 | | |
573 | 574 | | |
574 | 575 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| 84 | + | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
| |||
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
| 135 | + | |
133 | 136 | | |
134 | 137 | | |
135 | 138 | | |
| |||
168 | 171 | | |
169 | 172 | | |
170 | 173 | | |
| 174 | + | |
171 | 175 | | |
172 | 176 | | |
173 | 177 | | |
| |||
218 | 222 | | |
219 | 223 | | |
220 | 224 | | |
| 225 | + | |
221 | 226 | | |
222 | 227 | | |
223 | 228 | | |
| |||
280 | 285 | | |
281 | 286 | | |
282 | 287 | | |
| 288 | + | |
283 | 289 | | |
284 | 290 | | |
285 | 291 | | |
| |||
337 | 343 | | |
338 | 344 | | |
339 | 345 | | |
| 346 | + | |
340 | 347 | | |
341 | 348 | | |
342 | 349 | | |
| |||
387 | 394 | | |
388 | 395 | | |
389 | 396 | | |
| 397 | + | |
390 | 398 | | |
391 | 399 | | |
392 | 400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| 84 | + | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
| |||
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| 123 | + | |
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
| |||
180 | 183 | | |
181 | 184 | | |
182 | 185 | | |
| 186 | + | |
183 | 187 | | |
184 | 188 | | |
185 | 189 | | |
| |||
242 | 246 | | |
243 | 247 | | |
244 | 248 | | |
| 249 | + | |
245 | 250 | | |
246 | 251 | | |
247 | 252 | | |
| |||
328 | 333 | | |
329 | 334 | | |
330 | 335 | | |
| 336 | + | |
331 | 337 | | |
332 | 338 | | |
333 | 339 | | |
| |||
378 | 384 | | |
379 | 385 | | |
380 | 386 | | |
| 387 | + | |
381 | 388 | | |
382 | 389 | | |
383 | 390 | | |
| |||
428 | 435 | | |
429 | 436 | | |
430 | 437 | | |
| 438 | + | |
431 | 439 | | |
432 | 440 | | |
433 | 441 | | |
| |||
485 | 493 | | |
486 | 494 | | |
487 | 495 | | |
| 496 | + | |
488 | 497 | | |
489 | 498 | | |
490 | 499 | | |
| |||
529 | 538 | | |
530 | 539 | | |
531 | 540 | | |
532 | | - | |
| 541 | + | |
533 | 542 | | |
534 | 543 | | |
535 | 544 | | |
| |||
542 | 551 | | |
543 | 552 | | |
544 | 553 | | |
| 554 | + | |
545 | 555 | | |
546 | 556 | | |
547 | 557 | | |
| |||
604 | 614 | | |
605 | 615 | | |
606 | 616 | | |
| 617 | + | |
607 | 618 | | |
608 | 619 | | |
609 | 620 | | |
| |||
672 | 683 | | |
673 | 684 | | |
674 | 685 | | |
| 686 | + | |
675 | 687 | | |
676 | 688 | | |
677 | 689 | | |
| |||
730 | 742 | | |
731 | 743 | | |
732 | 744 | | |
| 745 | + | |
733 | 746 | | |
734 | 747 | | |
735 | 748 | | |
| |||
780 | 793 | | |
781 | 794 | | |
782 | 795 | | |
| 796 | + | |
783 | 797 | | |
784 | 798 | | |
785 | 799 | | |
| |||
848 | 862 | | |
849 | 863 | | |
850 | 864 | | |
| 865 | + | |
851 | 866 | | |
852 | 867 | | |
853 | 868 | | |
| |||
898 | 913 | | |
899 | 914 | | |
900 | 915 | | |
| 916 | + | |
901 | 917 | | |
902 | 918 | | |
903 | 919 | | |
| |||
960 | 976 | | |
961 | 977 | | |
962 | 978 | | |
| 979 | + | |
963 | 980 | | |
964 | 981 | | |
965 | 982 | | |
| |||
1010 | 1027 | | |
1011 | 1028 | | |
1012 | 1029 | | |
| 1030 | + | |
1013 | 1031 | | |
1014 | 1032 | | |
1015 | 1033 | | |
| |||
1078 | 1096 | | |
1079 | 1097 | | |
1080 | 1098 | | |
| 1099 | + | |
1081 | 1100 | | |
1082 | 1101 | | |
1083 | 1102 | | |
| |||
1128 | 1147 | | |
1129 | 1148 | | |
1130 | 1149 | | |
| 1150 | + | |
1131 | 1151 | | |
1132 | 1152 | | |
1133 | 1153 | | |
| |||
1178 | 1198 | | |
1179 | 1199 | | |
1180 | 1200 | | |
| 1201 | + | |
1181 | 1202 | | |
1182 | 1203 | | |
1183 | 1204 | | |
| |||
1228 | 1249 | | |
1229 | 1250 | | |
1230 | 1251 | | |
| 1252 | + | |
1231 | 1253 | | |
1232 | 1254 | | |
1233 | 1255 | | |
| |||
0 commit comments