Skip to content

fix(core): lexicons and cache after install/upgrade#16920

Open
Ibochkarev wants to merge 2 commits intomodxcms:3.xfrom
Ibochkarev:fix/15465-14952-lexicon-cache-upgrade
Open

fix(core): lexicons and cache after install/upgrade#16920
Ibochkarev wants to merge 2 commits intomodxcms:3.xfrom
Ibochkarev:fix/15465-14952-lexicon-cache-upgrade

Conversation

@Ibochkarev
Copy link
Copy Markdown
Collaborator

What does it do?

  • [3.x] Not clear cache after upgrade MODX 2.7.2 to MODX 3.0.0-alpha1 #14952: After upgrade or install, all cache partitions (including lexicon_topics) are cleared via cacheManager->refresh() in upgrade.install.php (before return true) and in modinstallrunnerweb::cleanup() after deleteTree, so the manager shows correct data on first load.
  • Lexicons are not displayed after installation and the first login to the admin panel #15465: In Workspace/Lexicon/GetList, when namespace is core and file-based topic is empty, lexicon cache is cleared and getFileTopic() is retried once; DEBUG log added for that path. Inline parseArray() is replaced by a private method filterEntriesByQuery() to avoid "Cannot redeclare" on repeated processor calls; PHP 8+ robustness added (is_string for value, (string) for key).
  • Cache busting (#581288394): Static manager assets (ExtJS, popper, index/login CSS/JS, lang.js.php, modx.config.js.php) in templates header.tpl, browser/index.tpl, security/login.tpl, security/logout.tpl now use ?v={$versionToken} (or &v= where URL already has query). versionToken is derived from settings_version and uuid, so it changes after upgrade and the browser fetches new assets.

Why is it needed?

How to test

  1. Upgrade path: Upgrade from 2.7.x to 3.x via setup; confirm manager loads without manual cache clear and lexicons display.
  2. Fresh install: Clean install from git/setup; open manager and open Lexicon management; confirm entries show keys and values (no need to refresh).
  3. Cache busting: After upgrade, hard-refresh manager; confirm assets load (no stale Ext/CSS). Optional: change settings_version and reload manager; confirm asset URLs get new v= and browser fetches new files.

Related issue(s)/PR(s)

Resolves #15465
Resolves #14952

…odxcms#14952)

- Clear all cache partitions (incl. lexicon_topics) in upgrade.install.php
  and in modinstallrunnerweb::cleanup() via cacheManager->refresh()
- GetList: retry getFileTopic once for core when empty, with clearCache
  and DEBUG log; replace inline parseArray with filterEntriesByQuery()
- Cache busting: add ?v=versionToken to manager assets in header, browser,
  login, logout templates (comment #581288394)
@Ibochkarev Ibochkarev changed the title fix(core): lexicons and cache after install/upgrade (#15465, #14952) fix(core): lexicons and cache after install/upgrade Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant