Correcting disabling feature from command line

- http://orchard.codeplex.com/workitem/16524

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2010-10-15 14:29:04 -07:00
parent 0d5c2db898
commit 054bd9f76e
2 changed files with 3 additions and 2 deletions

View File

@@ -79,7 +79,7 @@ namespace Orchard.Modules.Commands {
[CommandName("feature disable")]
public void Disable(params string[] 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)));
}
}

View File

@@ -95,9 +95,10 @@ namespace Orchard.Modules.Services {
public void DisableFeatures(IEnumerable<string> features, bool force) {
var shellDescriptor = _shellDescriptorManager.GetShellDescriptor();
var enabledFeatures = shellDescriptor.Features.ToList();
var availableFeatures = GetAvailableFeatures().ToList();
var featuresToDisable =
features.Select(s => DisableFeature(s, GetAvailableFeatures(), force)).SelectMany(
features.Select(s => DisableFeature(s, availableFeatures, force)).SelectMany(
ies => ies.Select(s => s));
if (featuresToDisable.Count() == 0)