Repository navigation
MDL-BUTTON02: also flag own-container names in data sources and widget expressions - #1018
Merged
Merged
Conversation
A data container's widget-name variable is in scope only one data container below it, and that holds for every slot evaluated in a widget's enclosing context, not only action arguments. Measured on mxbuild 11.14.0, each against a control one data view deeper that builds clean: a nested widget's microflow data-source argument, Visible, Editable and DynamicClasses reading the container they sit in directly are CE0117, and a nested list's XPath `where` is CE0161. All five passed check and exec. checkOwnContainerName now takes the widget and walks its action arguments, data-source arguments and XPath, and those expression properties, naming the CE code per slot. Text-template parameters are left alone: MDL-WIDGET24 already refuses a variable path there. Refs mendixlabs#1324 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QLPboEFUCLXZr6qwX2T9LF
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.
Follow-up to #1013 (mendixlabs#1324).
Summary
A data container's widget-name variable (
$dvPfordataview dvP) only exists for data containers nested belowdvP. IndvP's own context the object is$currentObject. #1013 checked this rule for action arguments only. The same scope applies to every slot evaluated in a widget's enclosing context, and those slots passedcheckandexecand then failed the build.Measured on Mendix 11.14.0. Each shape sits directly inside
dvP, with a control one data view deeper:$dvPread indvDsOwnVisible:cVisOwnEditable:DynamicClasses:cClsOwnwherelvXpOwnChanges
checkOwnContainerName(mdl/executor/validate_page_button_context.go) now takes the widget and checks its action arguments, data-source arguments, data-source XPath, and itsVisible/Editable/DynamicClassesexpressions. Each error carries that slot's CE code.Visible:andEditable:are stored asVisibleIf/EditableIf, but the message uses the names the author wrote.mdl-examples/bug-tests/1324-own-data-container-name-outside-actions.fail.mdl, updates the widgets reference, error cheatsheet and CHANGELOG, and appends a finding tomdl-executor.jsonl.Evidence
TestValidatePageButtonContext_OwnContainerName_OutsideActionsfailed withflagged ""before the change.flagged ""again.checkflags exactly the five failing widgets, andexecrefuses them. Rewriting all five to$currentObjectbuilds withThe app contains: 0 errors..mdlscripts inmdl-examples/and.claude/skills/triggers MDL-BUTTON02.make build,make test,make lint,make check-mdlandmake check-findingspass on the currentmain.make check-skill-mdlpassed before the rebase, which only resolved a CHANGELOG conflict.🤖 Generated with Claude Code
https://claude.ai/code/session_01QLPboEFUCLXZr6qwX2T9LF
Generated by Claude Code