Skip to content

ALTER PAGE: set Title = '…' returns success but does not update page title #561

@ako

Description

@ako

Summary

Page-level set Title = '…' in an ALTER PAGE block reports Altered page … but the title in BSON is unchanged. describe page after the SET still shows the old title.

Reproduction

create or replace page Demo.Foo (
  Title: 'Old Title',
  Layout: Atlas_Core.Atlas_Default
) {
  layoutgrid lg1 {
    row r1 {
      column c1 (DesktopWidth: AutoFill) {
        container c (Class: 'x')
      }
    }
  }
};

alter page Demo.Foo {
  set Title = 'New Title'
};

Then:

./bin/mxcli -p app.mpr -c "describe page Demo.Foo"

Output still shows Title: 'Old Title'. The ALTER reports Altered page Demo.Foo so there's no error surfaced.

Root cause (suspected)

mdl/backend/mpr/page_mutator.go:1536 applyPageLevelSetMut handles Title by calling setTranslatableText(rawData, "Title", value). The title in page BSON is stored as a translatable text structure (Texts$Text with Translations[]); setTranslatableText likely needs to either:

  • Find the existing Translation entry for the default language and update its Text
  • Or replace the entire Title BSON with a new TranslatableText

I haven't dug into setTranslatableText to confirm — could also be hitting the FormCall branch incorrectly (line 1539: if formCall := dGetDoc(rawData, "FormCall"); formCall != nil { setTranslatableText(formCall, "Title", value) }), but pages do have a FormCall wrapper.

Workaround

Re-issue the page with create or replace page and the new title.

Notes

  • set Url = '…' is documented but not tested in this repro — may have a similar issue.
  • The skill .claude/skills/mendix/alter-page.md documents set title = 'Edit Customer' as supported (line 66 row).

Discovered

While building mdl-examples/doctype-tests/33-alter-page-examples.mdl (commit 01ad80e0); AP01 was originally set Title = 'Products' and was silently no-op'd, prompting removal of that step.

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