Skip to content

fix(widgets): read an object property's sub-properties declared without a propertyGroup - #1633

Open
stagknee wants to merge 1 commit into
mendixlabs:mainfrom
stagknee:fix/mpk-object-direct-properties
Open

stagknee wants to merge 1 commit into
mendixlabs:mainfrom
stagknee:fix/mpk-object-direct-properties

Conversation

@stagknee

Copy link
Copy Markdown
Contributor

Closes #1632.

What it fixes

Every Marketplace Calendar written by mxcli failed a plain mx check with CE0463 "The definition of this widget has changed". mxcli docker check hid it, because it runs update-widgets on a temporary copy first.

The Calendar has no embedded template, so its Type is generated from the .mpk. Its toolbarItems object list declares its sub-properties directly under <properties>, each with a <category> element. modelsdk/widgets/mpk read only <properties><propertyGroup>, so toolbarItems had no Children and was stored with ValueType.ObjectType: null.

How

  • xmlProperty gains NestedDirectProps (properties>property) and Category.
  • nestedGroups returns the declared groups plus one caption-less group holding the direct sub-properties. Both call sites (top-level and nested object properties) use it.
  • collectNestedProperties gives a sub-property outside any group its own <category>. Grouped sub-properties keep their caption chain, unchanged.

sdk/widgets/mpk (used by widget init, the catalog and the widget docs) already reads both shapes. This brings the template-side parser in line with it, using the same field name and order.

Also included: CHANGELOG (Fixed), a finding in findings/modelsdk/, and mdl-examples/bug-tests/1632-calendar-toolbaritems-definition.mdl.

Evidence

  • Tests:

    • modelsdk/widgets/mpk/objectdirect_test.go covers parsing: direct sub-properties in document order with their own category and attributes, and a grouped control that keeps its group caption.
    • modelsdk/widgets/objectdirect_test.go covers the path end to end, from a zipped .mpk through ParseMPK to GenerateFromMPK: the object property gets a WidgetObjectType with both sub-property types, and itemType gets the category Appearance.
    • Both fail on main and pass with the fix.
  • Real run (Mendix 11.12.5 scratch app, Calendar 2.6.1), plain mx check after exec. "main" here is the 2026-10-20 nightly (3b24e5a), whose modelsdk/widgets is identical to current main:

    Script main this branch
    bug-tests/1632-calendar-toolbaritems-definition.mdl 1 × CE0463 0 errors
    bug-tests/1578-calendar-expression-properties.mdl 2 × CE0463 0 errors
    • The stored Calendar pages are identical (ids stripped) to a copy that mx update-widgets rewrote.
    • Control: doctype-tests/32-pluggable-widget-object-lists-v010.mdl covers Accordion, PopupMenu, Maps static and dynamic, area and line chart, and heat map. All 9 pages are stored identically by main and by this branch, ids stripped. One line-chart value (smooth) had to change to spline, because the app's Charts version doesn't accept it.
    • That fixture's Maps map2 reports CE0463 on both main and this branch, so it's unrelated and left alone.
  • Windows: go test ./modelsdk/... passes. ./mdl/executor/, ./mdl/catalog/ and ./cmd/mxcli/ show the same failures as unchanged main on Windows: 28 executor tests (layout, describe, OData file paths, type checking) and TestSaveToFile_ConcurrentWritersAndReaders. go vet and gofmt are clean.

  • Linux (golang:1.26.6-bookworm, ANTLR 4.13.2): make grammar build test check-mdl check-findings check-conformance check-migration-reference lint-go all pass.

🤖 Generated with Claude Code

…ut a propertyGroup (mendixlabs#1632)

Every Marketplace Calendar written by mxcli failed a plain `mx check` with
CE0463 "The definition of this widget has changed". The Calendar has no
embedded template, so its Type is generated from the .mpk, and its
toolbarItems object list declares its sub-properties directly under
<properties>, each with a <category> element. modelsdk/widgets/mpk read
only <properties><propertyGroup>, so toolbarItems had no Children and was
stored with ValueType.ObjectType null.

The parser now reads both shapes, as sdk/widgets/mpk already does; a
direct sub-property takes its category from its own <category>. On an
11.12.5 app the stored Calendar equals a copy rewritten by
`mx update-widgets` (ids stripped), and the object-list widgets of
doctype-tests/32 are stored byte-identical to before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ako added a commit that referenced this pull request Oct 23, 2026
…ues-bkrdmk

fix: find/filter by System.owner builds, and describe keeps System associations qualified

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CE0463 on a pluggable widget whose object-list property declares its sub-properties without a <propertyGroup> (Marketplace Calendar toolbarItems)

1 participant