Skip to content

[2.x] fix(core): rebuild the formatter when any extension is toggled - #5434

Open
imorland wants to merge 1 commit into
2.xfrom
im/check-issue-3758-2x
Open

imorland wants to merge 1 commit into
2.xfrom
im/check-issue-3758-2x

Conversation

@imorland

@imorland imorland commented Nov 8, 2026

Copy link
Copy Markdown
Member

Fixes #3758

Changes proposed in this pull request:
Toggling an extension only flushed the formatter cache when that extension registered Extend\Formatter itself. Extensions that configure the formatter based on which other extensions are enabled were left with a stale formatter: after enabling tags, #tag was saved as plain text, and after disabling it, replying with #tag failed with a 500 until php flarum cache:clear was run. Core now flushes the formatter whenever any extension is enabled or disabled, like it already does for the frontend assets and locale caches.

Reviewers should focus on:

  • The test fires Enabled/Disabled directly: the testing harness pins the enabled extensions per test case, so a real toggle can't change isEnabled() inside a test. The tags/mentions case was checked by hand on a dev forum, both directions.
  • Multi-server setups with separate local storage still only flush on the server that handled the toggle; that already applies to cache:clear and isn't changed here.

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Backend changes: tests are green (run composer test).
  • Backend changes: tests have been added, or are not appropriate here.
  • Core developer confirmed locally this works as intended.
  • The description above is written by me and describes what this pull request actually does.

Extensions can configure the formatter differently depending on which other
extensions are enabled (mentions only adds tag mentions while tags is
enabled), but the formatter cache was only flushed when the toggled
extension itself registered formatter extenders.

Fixes #3758
@imorland
imorland requested a review from a team as a code owner November 8, 2026 13:50
@imorland imorland added this to the 2.1 milestone Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enabling/Disabling extensions should clear the cache

1 participant