mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Correcting disabling feature from command line
- http://orchard.codeplex.com/workitem/16524 --HG-- branch : dev
This commit is contained in:
@@ -79,7 +79,7 @@ namespace Orchard.Modules.Commands {
|
|||||||
[CommandName("feature disable")]
|
[CommandName("feature disable")]
|
||||||
public void Disable(params string[] featureNames) {
|
public void Disable(params string[] featureNames) {
|
||||||
Context.Output.WriteLine(T("Disabling features {0}", string.Join(",", featureNames)));
|
Context.Output.WriteLine(T("Disabling features {0}", string.Join(",", featureNames)));
|
||||||
_moduleService.DisableFeatures(featureNames);
|
_moduleService.DisableFeatures(featureNames, true);
|
||||||
Context.Output.WriteLine(T("Disabled features {0}", string.Join(",", featureNames)));
|
Context.Output.WriteLine(T("Disabled features {0}", string.Join(",", featureNames)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,9 +95,10 @@ namespace Orchard.Modules.Services {
|
|||||||
public void DisableFeatures(IEnumerable<string> features, bool force) {
|
public void DisableFeatures(IEnumerable<string> features, bool force) {
|
||||||
var shellDescriptor = _shellDescriptorManager.GetShellDescriptor();
|
var shellDescriptor = _shellDescriptorManager.GetShellDescriptor();
|
||||||
var enabledFeatures = shellDescriptor.Features.ToList();
|
var enabledFeatures = shellDescriptor.Features.ToList();
|
||||||
|
var availableFeatures = GetAvailableFeatures().ToList();
|
||||||
|
|
||||||
var featuresToDisable =
|
var featuresToDisable =
|
||||||
features.Select(s => DisableFeature(s, GetAvailableFeatures(), force)).SelectMany(
|
features.Select(s => DisableFeature(s, availableFeatures, force)).SelectMany(
|
||||||
ies => ies.Select(s => s));
|
ies => ies.Select(s => s));
|
||||||
|
|
||||||
if (featuresToDisable.Count() == 0)
|
if (featuresToDisable.Count() == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user