Skip to content

Remove orphaned preview topmenu lexicon keys - #17131

Open
Ibochkarev wants to merge 1 commit into
modxcms:3.xfrom
Ibochkarev:fix/orphaned-preview-lexicon
Open

Ibochkarev wants to merge 1 commit into
modxcms:3.xfrom
Ibochkarev:fix/orphaned-preview-lexicon

Conversation

@Ibochkarev

@Ibochkarev Ibochkarev commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

What changed and why

Removed the orphaned preview and preview_desc entries from core/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 no preview entry in _build/data/transport.core.menus.php, MODx.preview no longer exists in the manager sources, and git grep finds 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

  1. php -l core/lexicon/en/topmenu.inc.php — no syntax errors.
  2. git grep -n "preview" -- core/lexicon/en/topmenu.inc.php — no matches. (Matches remain in non-English topmenu.inc.php files until Crowdin syncs the source change.)
  3. Optionally run php _build/lexicon/checklexicon.php with your _build/build.config.php / _build/build.properties.php — preview_desc disappears from the generated _superfluous.php.
  4. Open the manager top menu: there is no Preview Site item (that was already the case after Reorganize main menu #16530), and no [[%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. The preview key is still defined in default.inc.php and resource.inc.php, so this PR removes the duplicate topmenu entry (and its Preview Site value), not the key globally. Completely removing preview from 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 topmenu topic and relied on its preview value would no longer get it from that topic, but core does not do this and the key remains available in the default and resource topics. 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, and checklexicon.php as described above. The existing modLexiconTest covers 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.

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
@Ibochkarev Ibochkarev added the area-lexicons Issues related to translations and lexicons implementation. label Nov 14, 2026

@smg6511 smg6511 left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine since the keys aren't currently used.

A couple things to consider:

  • The 'preview' key also appears in the default and resource topics — 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-lexicons Issues related to translations and lexicons implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Orphaned topmenu lexicon keys preview/preview_desc after #16530 removed the Preview Site menu item

2 participants