Closed ghost closed 4 years ago
Are you disabling any of those plugins in your cms.php config file? https://github.com/octobercms/october/blob/master/modules/system/classes/PluginManager.php#L469
Otherwise, the only thing I can think of is that the client is accidentally disabling the plugins, as the UX for managing the enabled state of the plugins right now isn't the greatest.
@LukeTowers - Nope, the plugin isn't being disabled in the config file and the client doesn't have access to that area of the back end.
@edhardie @neilcarpenter1 Bizarre. Well the link posted earlier is how that file gets generated, so I would look there to start with
Yep, bizzare indeed. Like a say it's only occasional, but when it happens all plugins in the back end show as enabled yet two make their way into the disabled.json file.
I'll have a look at the file you linked and see if I can dig up any more information. Thanks for the nudge in the right direction 😃
I wanted to take a look at this problem but im not getting an replicated issues with it. @LukeTowers if the PR i submitted works for this then we can close this. @edhardie ill need yo to test this when it is pushed,
I'm facing the same issue, some plugins are getting added to disabled.json
automatically "intermittently" as @edhardie described.
@abdulla-allaith are you able to nail down the process to a set of reproducible steps? We can't do anything unless we can reliably reproduce the issue.
Hi all. @Teranode I can have a go at testing for you if you've got some code I can run. I've got this very hacky temporary fix in place in modules/system/classes/PluginManager.php
protected function loadDisabled()
{
$path = $this->metaFile;
if (($configDisabled = Config::get('cms.disablePlugins')) && is_array($configDisabled)) {
foreach ($configDisabled as $disabled) {
$this->disabledPlugins[$disabled] = true;
}
}
if (File::exists($path)) {
$disabled = json_decode(File::get($path), true) ?: [];
if ($disabled['MyOwn.Plugin']) { unset($disabled['MyOwn.Plugin']); }
if ($disabled['RainLab.GoogleAnalytics']) { unset($disabled['RainLab.GoogleAnalytics']); }
$this->disabledPlugins = array_merge($this->disabledPlugins, $disabled);
}
else {
$this->writeDisabled();
}
}
With those two being the plugins that caused problems.
@abdulla-allaith we might be able to narrow this down a bit further now it's not just me and @neilcarpenter1 seeing this. What OS and PHP version are you running? Which plugins do you have installed and which are the ones that get added to the disabled.json?
@edhardie Sorry I just found out my issue is different, in which I have disabled plugins and I was not able to re-enable them. Even if I deleted them from disabled.json
they always came back. I found the solution in #2714 and my plugins are now enabled and they do not get disabled like before.
Closing as it has been over a month since any activity on this occurred and we are trying to figure out what issues are still relevant. If this is still something that you would like to see through to fruition please respond and we can get the ball rolling.
Expected behavior
storage/cms/disabled.json is a true reflection of the plugins that are disabled in manage plugins
Actual behavior
Occasionally, I see plugins that are not disabled added to storage/cms/disabled.json - this breaks the functionality of one of my clients sites.
Reproduce steps
This happens intermittently upon save in the back end and isn't tied to any particular plug-in.
October build
october/backend v1.0.419
It's a tricky one to catch so any pointers on where to start looking, perhaps around how disabled.json gets built up would be appreciated.