Skip to content

Commit 8ead1cf

Browse files
akoclaude
andcommitted
fix: unique placeholder IDs for TextTemplate translations + rename #30 fixture
CI integration test (TestMxCheck_DoctypeScripts) caught two regressions from this session's CE0463 work that local unit tests didn't surface: 1. Duplicate \$ID on TextTemplate translations (real bug) Commit f9818394 (TextTemplate translation defaults) bulk-edited 4 embedded templates to add Texts\$Translation entries inside WidgetValue.TextTemplate.Template.Items. The script used a literal placeholder \$ID of '00000000000000000000000000000000' for ALL added entries. When a project has multiple instances of a widget on one page (e.g. two textfilters in two columns), the embedded template's collectIDs remapping treats same-string \$IDs as the same logical entity and remaps them to one new UUID — producing duplicate GUIDs across widget instances: mx update-widgets ERROR: Duplicate Guid in unit page 'CWTest.P_Gallery_Filtered'. Object types: Mendix.Modeler.Texts.Translation, Mendix.Modeler.Texts.Translation. Studio Pro then fails to reload the project ("Root unit not found"). Fix: remapped 10 duplicate placeholder \$IDs across the 4 templates to follow the existing placeholderID() convention (aa00...XXXXXX with a unique counter per entry). The remapping logic in sdk/widgets/loader.go now sees each entry as a distinct entity and generates unique UUIDs per instance. Affected templates: combobox.json 2 entries datagrid-dropdown-filter.json 2 entries datagrid-number-filter.json 3 entries datagrid-text-filter.json 3 entries 2. Rename 30-pluggable-widget-examples.mdl → .test.mdl Script #30 references pluggable widgets (Badge, ProgressBar, Tooltip, Accordion, Timeline, Maps, TreeNode, PopupMenu, etc.) that aren't built-in and require their .mpk files in the project's widgets/ folder + mxcli widget init. The integration test creates a blank project that doesn't have them; \`mxcli exec\` failed with "no definition for widget com.mendix.widget.custom.badge.Badge". Renamed to .test.mdl so the integration test skips it (matches the convention used by other unrunnable-in-blank-project syntax references like #32). Added a header note explaining the rationale. Verified: TestMxCheck_DoctypeScripts now passes (150s) with the same build flags CI uses. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e8b2173 commit 8ead1cf

5 files changed

Lines changed: 17 additions & 10 deletions

File tree

mdl-examples/doctype-tests/30-pluggable-widget-examples.mdl renamed to mdl-examples/doctype-tests/30-pluggable-widget-examples.test.mdl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
-- Pluggable Widget Examples — PLUGGABLEWIDGET syntax
44
-- ============================================================================
55
--
6+
-- Filename uses `.test.mdl` suffix so `make test-integration` skips it.
7+
-- This file is a syntax reference, not a working executable script:
8+
-- the pluggable widgets it uses (Badge, ProgressBar, Tooltip, Accordion,
9+
-- Timeline, Maps, etc.) require their `.mpk` files in the project's
10+
-- `widgets/` folder + `mxcli widget init` to be runnable. The integration
11+
-- test creates a blank project that doesn't have those.
12+
--
613
-- Tests the PLUGGABLEWIDGET keyword that drives the def.json-based pluggable
714
-- widget engine. These are distinct from the static DATAGRID/GALLERY/COMBOBOX/
815
-- IMAGE keywords, which have their own dedicated builders.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,13 +1208,13 @@
12081208
"Items": [
12091209
3.0,
12101210
{
1211-
"$ID": "00000000000000000000000000000000",
1211+
"$ID": "aa000000000000000000000000000001",
12121212
"$Type": "Texts$Translation",
12131213
"LanguageCode": "en_US",
12141214
"Text": "Select all"
12151215
},
12161216
{
1217-
"$ID": "00000000000000000000000000000000",
1217+
"$ID": "aa000000000000000000000000000002",
12181218
"$Type": "Texts$Translation",
12191219
"LanguageCode": "nl_NL",
12201220
"Text": "Selecteer alles"

sdk/widgets/templates/mendix-11.6/datagrid-dropdown-filter.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2158,13 +2158,13 @@
21582158
"Items": [
21592159
3.0,
21602160
{
2161-
"$ID": "00000000000000000000000000000000",
2161+
"$ID": "aa000000000000000000000000000003",
21622162
"$Type": "Texts$Translation",
21632163
"LanguageCode": "en_US",
21642164
"Text": "None"
21652165
},
21662166
{
2167-
"$ID": "00000000000000000000000000000000",
2167+
"$ID": "aa000000000000000000000000000004",
21682168
"$Type": "Texts$Translation",
21692169
"LanguageCode": "nl_NL",
21702170
"Text": "Niets"

sdk/widgets/templates/mendix-11.6/datagrid-number-filter.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,19 +472,19 @@
472472
"Items": [
473473
3.0,
474474
{
475-
"$ID": "00000000000000000000000000000000",
475+
"$ID": "aa000000000000000000000000000005",
476476
"$Type": "Texts$Translation",
477477
"LanguageCode": "en_US",
478478
"Text": "Search"
479479
},
480480
{
481-
"$ID": "00000000000000000000000000000000",
481+
"$ID": "aa000000000000000000000000000006",
482482
"$Type": "Texts$Translation",
483483
"LanguageCode": "de_DE",
484484
"Text": "Suche"
485485
},
486486
{
487-
"$ID": "00000000000000000000000000000000",
487+
"$ID": "aa000000000000000000000000000007",
488488
"$Type": "Texts$Translation",
489489
"LanguageCode": "nl_NL",
490490
"Text": "Zoeken"

sdk/widgets/templates/mendix-11.6/datagrid-text-filter.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,19 +1286,19 @@
12861286
"Items": [
12871287
3.0,
12881288
{
1289-
"$ID": "00000000000000000000000000000000",
1289+
"$ID": "aa000000000000000000000000000008",
12901290
"$Type": "Texts$Translation",
12911291
"LanguageCode": "en_US",
12921292
"Text": "Search"
12931293
},
12941294
{
1295-
"$ID": "00000000000000000000000000000000",
1295+
"$ID": "aa000000000000000000000000000009",
12961296
"$Type": "Texts$Translation",
12971297
"LanguageCode": "de_DE",
12981298
"Text": "Suche"
12991299
},
13001300
{
1301-
"$ID": "00000000000000000000000000000000",
1301+
"$ID": "aa00000000000000000000000000000a",
13021302
"$Type": "Texts$Translation",
13031303
"LanguageCode": "nl_NL",
13041304
"Text": "Zoeken"

0 commit comments

Comments
 (0)