Skip to content

Quoted where '<xpath>' mis-stores every constraint (CE0161); only inline where [...] works #642

@marclehane-creator

Description

@marclehane-creator

mxcli version: v0.11.0 (2026-05-21) · OS: Windows 11 · Mendix project: runtime 11.10.0

Summary

The single-quoted where-clause form (where '<xpath>' with ''-escaped internal quotes) stores a malformed constraint, so mx check reports CE0161 for every constraint — even a trivial [Title='abc']. The inline bracket form (where [<xpath>]) stores correctly.

Minimal repro

Apply with mxcli exec -p <App.mpr> repro.mdl, then mx check:

create or modify persistent entity Administration.MxfQ (Title: String(100));

create or modify microflow Administration.Mf_Quoted ()
begin
  retrieve $L from Administration.MxfQ where '[Title=''abc'']';
  return;
end;

create or modify microflow Administration.Mf_Inline ()
begin
  retrieve $L from Administration.MxfQ where [Title='abc'];
  return;
end;

Expected

The quoted form un-escapes ''' and stores [Title='abc'], identical to the inline form. Both pass mx check.

Actual

  • Mf_QuotedCE0161 "Error(s) in XPath constraint."
  • Mf_Inline → clean.

It looks like the quoted string is stored without un-doubling the internal quotes (or without stripping the outer wrapper), producing an invalid constraint. mxcli exec reports no error; only mx check catches it.

Workaround

Emit constraints inline (where [<xpath>]), never quoted.

Impact

Any tooling or user that uses the quoted where-clause form gets CE0161 on all retrieves/datasources.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions