flarum / framework

Simple forum software for building great communities.
http://flarum.org/
6.39k stars 834 forks source link

Enabling/Disabling extensions should clear the cache #3758

Open SychO9 opened 1 year ago

SychO9 commented 1 year ago

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

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

davwheat commented 1 year ago

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.

SychO9 commented 1 year ago

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.