framework icon indicating copy to clipboard operation
framework copied to clipboard

Enabling/Disabling extensions should clear the cache

Open SychO9 opened this issue 1 year ago • 2 comments

Current Behavior

If you toggle an extension, the cache is not cleared. Cache clearing is necessary for situations where an extension being toggled requires for example, the formatter cache to be rebuilt so that it correctly renders content. This example situation occurs when an extension adds custom fomatter tags that optionally rely on another extension.

Such as the mentions extension adding support for tag mentions.

Steps to Reproduce

Toggle an extension that requires cache clearing.

Expected Behavior

Cache should be cleared.

Screenshots

No response

Environment

  • Flarum version: x.y.z
  • Website URL: http://example.com
  • Webserver: [e.g. apache, nginx]
  • Hosting environment: [e.g. shared, vps]
  • PHP version: x.y.z
  • Browser: [e.g. chrome 67, safari 11]

Output of php flarum info

Output of "php flarum info", run this in terminal in your Flarum directory.

Possible Solution

No response

Additional Context

No response

SychO9 avatar Mar 13 '23 09:03 SychO9

Anecdotally, enabling extensions also doesn't publish frontend assets bundled with the extension.

Not sure if this is an issue or my local environment, though.

davwheat avatar Mar 13 '23 11:03 davwheat

enabling extensions also doesn't publish frontend assets bundled with the extension.

Yea I don't think it does, we should centralise the listener for enabling/disabling extensions (logic is duplicated throughout the codebase) and then we should improve it to include what is necessary.

SychO9 avatar Mar 13 '23 12:03 SychO9