Repository navigation
Conversation
…otected module
check -p --references passed a flow in an ordinary module that did a
database retrieve of, or a create of, a Hidden entity of a Protected
(add-on) module; mxbuild refuses both with CE1406 ("Retrieve object(s)
activity / Create object activity ... is not allowed to use entity").
The entity was checked only in a flow's parameter and return types.
checkFlowMembers checked the members a create assigns and a retrieve's
XPath names, but not the entity itself, so a bare create or a retrieve
without where reached no check. It now calls entityRef for both, which
already resolves the stated, stored and script-created level and is
silent for a Usable entity, an ordinary module and an unknown entity.
Closes mendixlabs#1652
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1652
What does it do?
check -p --referencesnow reports CE1406 when a flow in an ordinary module does a databaseretrieveof, or acreateof, a Hidden entity of a Protected (add-on) module:Before this change both passed
checkandexec, and the build failed withRetrieve object(s) activity … is not allowed to use entity/Create object activity … is not allowed to use entity.Root cause: since #1498 an entity is checked only in a flow's parameter and return types
(
checkFlow). The flow-body check (checkFlowMembers) checked the members a create assigns and aretrieve's XPath names, but never
CreateObjectStmt.EntityTypeorRetrieveStmt.Source. A bare create,or a retrieve without
where, reached no check at all.Change:
checkFlowMemberscalls the existingentityReffor the entity of a create and of adatabase retrieve (not an association retrieve, which names an association and keeps its member check).
entityRefalready folds in the level the script states, the stored level, and Hidden for an entity thescript creates, and it is silent for a Usable entity, an ordinary module and an entity it cannot find.
The add-on module itself is still skipped. Small and focused: one file of logic, about ten lines.
Files
mdl/executor/validate_protected_module_members.go: entity check for create and database retrievemdl/executor/validate_protected_module_refs_test.go: nine cases inTestValidateProtectedModuleRefsCHANGELOG.md: entry under Unreleased / Fixed.claude/skills/fix-issue/findings/mdl-executor/2026-10-25-protected-module-hidden-entity-retrieve-create-ce1406.jsonTesting
New cases in
TestValidateProtectedModuleRefs(MockBackend fixture with a ProtectedMyAddOn):retrieve of a Hidden entity (with and without
where), bare create of a Hidden entity, the same in ananoflow; controls that stay clean: retrieve / create of a Usable entity, a Hidden entity the script
makes usable with
alter entity … set export level api, the add-on module using its own Hidden entity,and an ordinary module's Hidden entity.
validate_protected_module_members.goreverted, four cases fail(
retrieve_of_hidden_entity,…_with_where,bare_create_of_hidden_entity,…_in_a_nanoflow); with the fix they pass.make buildpasses;make lintpasses (lint-go, lint-ts, check-conformance, check-test-timeouts);make check-findingspasses.make testpasses. Locally on macOS the twoTestSyncJavaDependencies_*tests incmd/mxcli/dockerhang the same way onmain(their fakemxcallssetsid, which macOS lacks);with a
setsidshim on PATH that package passes too. Unrelated to this change.The issue's script was measured with
mx checkon Mendix 11.12.4 (three CE1406 errors, two of themthis shape) and with
checkontestdata/testapp(11.14.0).Checklist
check -p --referencesmisses CE1406 for a database retrieve or a create of a Hidden entity of a Protected module #1652 (split from the call-result gap,check -p --referencesdoes not type acall microflowresult, so a Hidden attribute of a Protected module read on it passes (CE1406) #1654, which has its own PR)mainmake check-findingspasses🤖 Generated with Claude Code