Skip to content

Verify Forms$FormSettings.TitleOverride: nil against Studio Pro BSON #468

@hjotha

Description

@hjotha

Source

Follow-up from ako's review on merged PR #338 (fix: write valid show-page parameter mappings).

Problem

PR #338 fixed `Forms$PageParameterMapping.Variable: nil` because Studio Pro rejected null embedded objects on project load. `Forms$FormSettings.TitleOverride` is written as `nil` in the same block (`sdk/mpr/writer_microflow_actions.go` around line 367). If TitleOverride is an embedded object, it needs the same empty-object treatment as Variable. If it is a string/expression scalar, `nil` is typically accepted.

Issue #295 (the reported bug) only mentioned Variable, so the current code may or may not cause a load failure depending on the Studio Pro version and the action context.

Expected behavior

`TitleOverride` in an authored MPR loads in Studio Pro without an "invalid project" error across all supported Mendix versions.

Proposed fix

  1. Dump a Studio Pro-generated MPR with a show-page action and inspect the raw BSON for the TitleOverride field. Confirm type (scalar vs embedded object).
  2. If embedded object: replace `nil` with an empty `Forms$TitleOverride` (or whatever the correct type is) document, mirroring `emptyPageVariable()`.
  3. If scalar: add a code comment documenting that null is intentional and verified.
  4. Add a regression test either way.

Related

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