Skip to content

NOT FOUND PAGE writes a project mx.exe cannot load (no error count emitted) #1000

Description

@mlehane1

Summary

CREATE OR REPLACE NAVIGATION … NOT FOUND PAGE <Module>.<Page> is documented in Part IV (Navigation Profiles, Home Pages and Menus) as "an optional custom 404 page". It passes the syntax check, the apply step reports success and exits 0 — and the project can then no longer be loaded by mx.exe at all.

Repro

Two statements on a fresh mxcli new … --version 11.13.0 app:

CREATE OR REPLACE PAGE MyFirstModule.P404 (Title: '404', Layout: Atlas_Core.Atlas_Default) { };
CREATE OR REPLACE NAVIGATION Responsive
  HOME PAGE MyFirstModule.P404
  NOT FOUND PAGE MyFirstModule.P404;

then mx.exe check <app>.mpr.

Actual

Apply reports Navigation profile 'Responsive' updated., exit 0. Then:

ERROR: Mendix.Modeler.Storage.StorageLoadException: One or more invalid values were detected
  while loading the project
 - An error occurred when trying to set the 'NotFoundHomepage' property of a Navigation profile
 ---> System.ArgumentException: Object of type 'Mendix.Modeler.WebUI.Navigation.HomePage'
      cannot be converted to type '…NotFoundHomePage'.

There is no The app contains: N errors. line at all — the project fails to load rather than failing validation, so any tooling that diffs the error count sees nothing rather than a regression.

Isolated with a control

On a fresh copy, one statement apart:

step result
baseline 0 errors
the same CREATE OR REPLACE NAVIGATION without the clause 0 errors (unchanged)
+ NOT FOUND PAGE project will not load

Environment

Reproduced on mxcli 0.19.0 / Mendix 11.13.0, and independently on mxcli 0.20.0 / Mendix 11.11.0 — so it is neither version-specific nor fixed by 0.20.0's navigation rework.

Recovery

Headless: re-run CREATE OR REPLACE NAVIGATION without the clause and the project loads again.

Suggested fix

Write a NotFoundHomePage into that slot rather than a HomePage, or refuse the clause at apply time if the correct type cannot be produced. The current behaviour is a silent success that leaves an unopenable project.

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