Skip to content

File Uploader: an allowedfileformat in configMode: 'simple' passes check and exec, then fails mx check with CE0463 — hidden TextTemplates inside object-list items are never nulled #1198

Description

@MendixMau

Environment: mxcli v0.24.0 (2026-09-24T05:44:35Z), same result on v0.23.0. Mendix 11.12.2 (mx check from mxbuild 11.12.2). Widget: Mendix File Uploader 2.5.0 (com.mendix.widget.web.FileUploader.mpk, taken from the Marketplace module package). Fresh app from mxcli new App --version 11.12.2, macOS. Upstream main at d3adfa43 has no changes to mdl/backend/widgetobj/ since v0.24.0.

Summary: An allowedfileformat item in the widget's default configMode: 'simple' (with predefinedType) is accepted by mxcli check and written by exec with 0 errors, but mx check then reports CE0463 "The definition of this widget has changed". The same widget with every item in configMode: 'advanced' is 0 errors, and uploads work end to end at runtime, so the widget and module setup are fine. Only the simple-mode item triggers it.

Steps to reproduce

  1. mxcli new App --version 11.12.2, copy com.mendix.widget.web.FileUploader.mpk (2.5.0) into widgets/, run mxcli widget init -p App.mpr.
  2. Create a context entity, a System.FileDocument specialisation with a reference to it, a create microflow (createFileAction) and a delete microflow (onUploadFailureFile), with grants.
  3. Put this uploader in a dataview on the context entity:
fileuploader "upFiles" (
  uploadMode: 'files',
  associatedFiles: association $currentObject/Uploads.Attachment_UploadRequest,
  readOnlyMode: false,
  createFileAction: microflow Uploads.ACT_CreateAttachment,
  onUploadFailureFile: microflow Uploads.ACT_DeleteAttachment,
  maxFileSize: 5,
  objectCreationTimeout: 10,
  enableCustomButtons: false
) {
  allowedfileformat "fmtTxt" (configMode: 'simple', predefinedType: 'plainTextFile')
  allowedfileformat "fmtZip" (configMode: 'advanced', mimeType: 'application/zip', extensions: '.zip', typeFormatDescription: 'ZIP archive')
}
  1. mxcli exec the page, then mx check App.mpr.

Actual

$ mxcli exec 02-simple-mode.mdl -p App.mpr
1 issues: 0 errors, 1 warnings, 0 info        (the warning is MPR010, layout grid, unrelated)
Replaced page Uploads.UploadRequest_NewEdit
$ mx check App.mpr
[error] [CE0463] "The definition of this widget has changed. Update this widget by right-clicking it and selecting 'Update widget', or select 'Update all widgets' to update all widgets in the app." at File uploader 'upFiles'
The app contains: 1 errors.

Expected: 0 errors, as with fmtTxt written as configMode: 'advanced', mimeType: 'text/plain', extensions: '.txt', typeFormatDescription: 'Text file' (that variant: The app contains: 0 errors.).

Cause (from reading main): the File Uploader's editorConfig hides the item's typeFormatDescription (a TextTemplate), via hideNestedPropertiesIn(..., "allowedFileFormats", n, ["mimeType","extensions","typeFormatDescription"]), when configMode is simple. editorconfig_extract.go does extract that rule with ListPropertyKey: "allowedFileFormats". But ApplyVisibilityRules (mdl/backend/widgetobj/builder.go) only looks rules up in the widget's top-level propertyTypeIDs and never reads ListPropertyKey. So a hidden TextTemplate inside an object-list item keeps its default-filled ClientTemplate, where the type definition expects null. It is the #574 nulling, not yet applied one level down.

Suggested fixes, ranked

  1. In ApplyVisibilityRules (or a sibling called from the object-list item build), apply rules with ListPropertyKey set per item: evaluate the rule's condition against that item's own primitive values (configMode), and null the item's hidden TextTemplate. We verified locally that writing null for the hidden typeFormatDescription gives mx check 0 errors and a working upload (the predefined type reaches the widget at runtime: the rejection message names "Plain Text (.txt)").
  2. At minimum, have check/exec warn when an object-list item sets a configMode whose nested visibility rules are not applied, so the CE0463 is not a surprise at mx check.

Workaround: write every format as configMode: 'advanced' with mimeType, extensions and typeFormatDescription.

Retest: steps 1–4 on a fresh app. Pass = mx check says The app contains: 0 errors. with the simple-mode item in place.

Related: #574 (top-level conditional visibility, closed), #999 (object-list item parsing for this widget, closed).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions