Repository navigation
fix: widget init gives a widget whose name is a built-in keyword its own - #2762
Merged
Merged
Conversation
List View Controls' com.mendix.widget.custom.listviewcontrols.DropDownFilter derived DROPDOWNFILTER, the keyword of the Data grid 2 drop-down filter, and every command warned that its definition is not registered. widget init told project widgets apart but never counted a built-in keyword as taken. Embedded definitions' and builder-owned keywords now seed the taken set, the package names the widget (LISTVIEWCONTROLSDROPDOWNFILTER), the file under the old name is removed, and the generator version is bumped so existing projects regenerate. Fixes #2707 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
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.
Fixes #2707 (upstream mendixlabs#1993).
Problem
In a project with List View Controls,
widget initwrotecom.mendix.widget.custom.listviewcontrols.DropDownFilteras.mxcli/widgets/dropdownfilter.def.jsonwithmdlName: DROPDOWNFILTER. That is the keyword of the built-in Data grid 2 drop-down filter. Every command loading the widget registry then warned three times that the definition is not registered asdropdownfilter. Deleting the file and re-runningwidget initregenerated the same one.scanProjectWidgetsalready separated two project widgets that derive one name (#1848). It did not count a built-in keyword as taken. The registry refuses a definition on an embedded definition's keyword or a builder-owned keyword (#1463), butwidget initdidn't know those.Fix
builtinWidgetKeywords: the embedded definitions' keywords, each with its widget ID, plus the builder-owned keywords. They seed the taken set, and a project widget deriving one of them for another widget is renamed throughqualifiedMDLName.customis now a generic ID segment, so the package names the widget:LISTVIEWCONTROLSDROPDOWNFILTER.removeRenamedDefinitionsdeletes a generated definition (one carryinggeneratorVersion) for the same widget under its old name. Without it, the old file would keep the warning alive. A hand-written definition is left alone.WidgetDefGeneratorVersion20 → 21, so existing projects regenerate once and pick up the rename.Evidence
mdl/executor/widget_defs_builtin_keyword_2707_test.gobuilds a List View Controls.mpkand the reporter's staledropdownfilter.def.json. Before the fix it failed with "the widget is registered as DROPDOWNFILTER". After it:LISTVIEWCONTROLSDROPDOWNFILTER;dropdownfilterstill resolves to the Data grid 2 filter.widget initon KnightShift's 40 real packages produces the same names before and after.make ci-localpassed.Generated by Claude Code