This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/lib/plugin
David Taylor 7926a1f7bb FIX: Remove plugin.enabled? checks at initialization time (#6166)
Checking `plugin.enabled?` while initializing plugins causes issues in two ways:
  - An application restart is required for changes to take effect. A load-balanced multi-server environment could behave very weirdly if containers restart at different times.
  - In a multisite environment, it takes the `enabled?` setting from the default site. Changes on that site affect all other sites in the cluster.

Instead, `plugin.enabled?` should be checked at runtime, in the context of a request. This commit removes `plugin.enabled?` from many `instance.rb` methods.

I have added a working `plugin.enabled?` implementation for methods that actually affect security/functionality:
  - `post_custom_fields_whitelist`
  - `whitelist_staff_user_custom_field`
  - `add_permitted_post_create_param`
2018-07-25 16:45:24 +01:00
..
auth_provider.rb Add rubocop to our build. (#5004) 2017-07-28 10:20:09 +09:00
filter_manager.rb Upgrade rspec to 3.4.0. 2016-05-30 11:38:38 +08:00
filter.rb (experimental) added framework for filtering all sorts of internals in discourse and consuming by plugins 2013-10-10 18:45:40 +11:00
instance.rb FIX: Remove plugin.enabled? checks at initialization time (#6166) 2018-07-25 16:45:24 +01:00
metadata.rb Add to offical plugins list 2018-06-18 10:20:49 -06:00