Skip to content

fix(pages): null hidden object-list item TextTemplates under nested visibility rules (closes #1198) - #1227

Open
MendixMau wants to merge 1 commit into
mendixlabs:mainfrom
MendixMau:fix/1198-nested-item-visibility
Open

MendixMau wants to merge 1 commit into
mendixlabs:mainfrom
MendixMau:fix/1198-nested-item-visibility

Conversation

@MendixMau

Copy link
Copy Markdown
Contributor

Closes #1198

What it does

When a pluggable widget's editorConfig hides a sub-property of an object-list item (a nested visibility rule, ListPropertyKey set), the builder kept the shipped default text in that item's required TextTemplate even while the rule hid it. Studio Pro stores null there, so mx check reports CE0463.

Found on File Uploader 2.5.0: allowedFileFormats[].typeFormatDescription is a required TextTemplate that is hidden when configMode = "simple", so every simple-mode format failed mx check.

ApplyVisibilityRules now skips nested rules at the top level and evaluates them per item. When a rule can be decided from the item's own primitive values and it fires, that item's TextTemplate is set to null.

Scope and blast radius

  • The code is generic. It applies to any pluggable widget whose editorConfig hides an object-list item sub-property, not only File Uploader.
  • It is narrow on purpose:
  • Widgets without nested rules take an early return, so they are unchanged.
  • DESCRIBE, the parser and top-level visibility handling are not changed.

Testing

  • make test: all 84 packages ok, on upstream main 9509176. gofmt and go vet are clean.
  • New unit test TestApplyPropertyVisibility_NestedObjectListItem covers two cases: a simple-mode item's hidden template is nulled, and an advanced-mode item's visible template is kept.

Mendix validation (11.12.2)

  • Page: a File Uploader in files mode with one simple format (.txt) and one advanced format (.zip).
  • Before: CE0463 on typeFormatDescription.
  • After:
    • mx check: 0 errors.
    • Runtime (mxcli run --local): both files uploaded and stored, 2 of 2.
    • Download: the downloaded bytes are sha256-equal to the source files, 2 of 2.
    • A .csv file is rejected by the widget and creates 0 rows.

Not tested: image mode, and opening the model in Studio Pro.

…isibility rules (closes mendixlabs#1198)

A pluggable widget whose editorConfig hides an object-list ITEM
sub-property (a nested rule, ListPropertyKey set) kept the shipped
default text in that item's required TextTemplate even while the rule
hid it. Studio Pro stores null there, so mx check reported CE0463.

Found on File Uploader 2.5.0: allowedFileFormats[].typeFormatDescription
is a required TextTemplate hidden when configMode = "simple", so every
simple-mode format failed mx check.

ApplyVisibilityRules now skips nested rules at the top level and
evaluates them per item: when the rule is determinable from the item's
own primitive values and fires, that item's TextTemplate is nulled.
Only the hidden direction and only TextTemplate values are touched; an
indeterminable rule leaves the item unchanged.

Tested: make test (84 packages ok), gofmt, go vet.
Mendix 11.12.2: simple-mode .txt format plus advanced .zip format,
mx check 0 errors, runtime upload of both files stored, downloaded
bytes sha256-equal to source (2/2), .csv rejected by the widget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DyrzWc5YejD1iBLgJ7TS7q
MendixMau added a commit to MendixMau/mxcli-project-toolkit that referenced this pull request Sep 28, 2026
…#1213, #671, #1061); #1198 PR opened as #1227

Each draft's status line now carries its issue or comment link and how the
filed text differs from the draft (retested on mxcli main 95091765 in a neutral
blank 11.12.2 app). The PR package README records mendixlabs/mxcli#1227.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

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

1 participant