Repository navigation
Remove orphaned preview topmenu lexicon keys - #17131
Open
Ibochkarev wants to merge 1 commit into
Open
Ibochkarev wants to merge 1 commit into
Ibochkarev wants to merge 1 commit into
Conversation
The Preview Site menu item and its MODx.preview() handler were removed in modxcms#16530, but the preview/preview_desc lexicon entries remained in the topmenu lexicon. Refs modxcms#17040
smg6511
approved these changes
Nov 15, 2026
Collaborator
There was a problem hiding this comment.
I think this is fine since the keys aren't currently used.
A couple things to consider:
- The
'preview'key also appears in thedefaultandresourcetopics — should those be removed as well? I think what happened is at some point we changed from using "Preview" to simply "View" (in the Resource editor button bar and the contextual menus), making that particular key obsolete. - If anyone decided they didn't like the removal of Preview Site as a main menu item, they could easily have added it back in by adding a new item via Menus using these keys we're removing (in the Lexicon Key and Description fields). Not a huge deal—they can easily just edit those items—just something to keep in mind.
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.
What changed and why
Removed the orphaned
previewandpreview_descentries fromcore/lexicon/en/topmenu.inc.php.PR #16530 ("Reorganize main menu") removed the Content → Preview Site menu item and its
MODx.preview()handler, but left these two lexicon strings behind. Nothing in the codebase references them anymore: there is nopreviewentry in_build/data/transport.core.menus.php,MODx.previewno longer exists in the manager sources, andgit grepfinds no_('preview')/lexicon('preview')usage. Keeping the strings makes translation tooling and documentation suggest a menu item that no longer exists.Only the English source lexicon is changed, per
.github/CONTRIBUTING.md: non-English lexicon files are managed through Crowdin and will pick up the removal on the next sync.How to test
php -l core/lexicon/en/topmenu.inc.php— no syntax errors.git grep -n "preview" -- core/lexicon/en/topmenu.inc.php— no matches. (Matches remain in non-Englishtopmenu.inc.phpfiles until Crowdin syncs the source change.)php _build/lexicon/checklexicon.phpwith your_build/build.config.php/_build/build.properties.php—preview_descdisappears from the generated_superfluous.php.[[%preview]]/[[%preview_desc]]placeholders appear anywhere.Related issue(s)/PR(s)
Resolves #17040
Related: #16530 removed the menu item and handler but not the strings.
Compatibility notes
Lexicon-data-only change; no DB migration, no template or JavaScript changes. Non-English locales are intentionally untouched in this PR (Crowdin).
One nuance: lexicon keys are global within a language — all topic files merge into one
$_lang. Thepreviewkey is still defined indefault.inc.phpandresource.inc.php, so this PR removes the duplicatetopmenuentry (and itsPreview Sitevalue), not the key globally. Completely removingpreviewfrom the shipped lexicons would be a separate, broader change.Breaking change assessment
No public API signature, return type, or default behavior changes. Core code does not use these keys. Add-ons that loaded the
topmenutopic and relied on itspreviewvalue would no longer get it from that topic, but core does not do this and the key remains available in thedefaultandresourcetopics. Safe for patch-level consumers.Test coverage
No automated tests added or modified: this is lexicon data with no executable logic. Validated with
php -l,git grep, andchecklexicon.phpas described above. The existingmodLexiconTestcovers lexicon loading, not the presence of individual keys.Contributors
@Ibochkarev — reported the issue and found the stale reference during a docs ↔ code audit.
AI tool use
OpenCode (DeepSeek V4.1 Flash Free) was used to search the codebase, verify there are no remaining references, run
checklexicon.php, and draft this description. The contributor reviewed the change and stands behind it.