Cms: [FR] A `safeMode` config setting to disable all plugins & modules

Created on 16 Oct 2019  ·  12Comments  ·  Source: craftcms/cms

Originally suggested by @khalwat on Discord...

It would be incredibly useful to have a config setting that neutralizes all plugins and modules. For the sake of this feature request, let's call it safeMode.

Use-Case 1

  • You want to report a bug in Craft, but want to be 100% sure that the bug isn't coming from a plugin or module (inspired by #5088). Putting the site into safeMode allows you to instantly diagnose whether or not the bug is Craft's fault.

Use-Case 2

  • You did something, somehow, that is preventing you from using the CP normally. In many cases, a safeMode config setting would allow you to get back in there and fix your mistake.

There are probably more use-cases as well, but these are the first ones that come to mind.

enhancement site development

Most helpful comment

We don’t have a non-hacky way of disabling modules, as those are part of the core application config, but I’ve just made it possible to set the disabledPlugins config setting to '*', which will disable all plugins.

All 12 comments

Use-Case 3

  • You encounter a bug related to plugin settings which has completely locked up the control panel. There is no way to "hack" the plugin or database, because project config handles the plugin settings in a very specific way.

Real-world example:
https://github.com/doublesecretagency/craft-cpcss/issues/12

The detail I miss most from having plugins stored in the database is that I could easily go into the db and toggle specific plugins on and off. It was useful for troubleshooting during plugin development and in various migration and upgrade scenarios.

Currently, I believe you can only do this if you have Project Config enabled and then you have to search through the file for each plugins enabled setting.

As you consider the "safeMode" feature it would be nice to also consider how this could be done on an individual-plugin basis, with or without Project Config enabled.

+1 to that... I really miss being able to toggle individual plugins on/off in the database.

If you just need to disable _specific_ plugins, you can do that with the disabledPlugins config setting:

'disabledPlugins' => ['cp-css'],

Just as there's a way to boot into Safe Mode on Windows and on the Mac... I think it could potentially be useful here as well FWIW.

Watching someone flail on Discord right now... Would really love to be able to tell them to "put it in safe mode".

This person has a bizarre error which is almost certainly unique to their environment. It would help significantly if they could quickly rule out plugins & modules as a source of interference.

We don’t have a non-hacky way of disabling modules, as those are part of the core application config, but I’ve just made it possible to set the disabledPlugins config setting to '*', which will disable all plugins.

That's pretty sweet @brandonkelly

Ah, solid! Totally fair that modules were excluded from this solution. Bulk disabling modules is easy enough, and would quickly lead to more complications anyway.

Thanks @brandonkelly! 🍺

Excellent!!

Craft 3.5.13 is out now with that change ✨

Was this page helpful?
0 / 5 - 0 ratings