mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-27 12:29:04 +08:00
#17898: Enabling dependent modules in Recipes from the gallery
Work Item: 17898 --HG-- branch : 1.x
This commit is contained in:
@@ -4,6 +4,7 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web.Hosting;
|
using System.Web.Hosting;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
|
using System.Xml.Linq;
|
||||||
using NuGet;
|
using NuGet;
|
||||||
using Orchard.Environment.Configuration;
|
using Orchard.Environment.Configuration;
|
||||||
using Orchard.Environment.Extensions.Models;
|
using Orchard.Environment.Extensions.Models;
|
||||||
@@ -227,8 +228,17 @@ namespace Orchard.Packaging.Controllers {
|
|||||||
.Where(feature => feature.Enable)
|
.Where(feature => feature.Enable)
|
||||||
.Select(feature => feature.FeatureDescriptor.Id);
|
.Select(feature => feature.FeatureDescriptor.Id);
|
||||||
|
|
||||||
// Enable the features and its dependencies
|
// Enable the features and its dependencies using recipes, so that they are run after the module's recipes
|
||||||
_moduleService.EnableFeatures(featureIds, true);
|
|
||||||
|
var recipe = new Recipe {
|
||||||
|
RecipeSteps = featureIds.Select(
|
||||||
|
x => new RecipeStep {
|
||||||
|
Name = "Feature",
|
||||||
|
Step = new XElement("Feature", new XAttribute("enable", x))
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
_recipeManager.Execute(recipe);
|
||||||
}
|
}
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
Services.Notifier.Error(T("Post installation steps failed with error: {0}", exception.Message));
|
Services.Notifier.Error(T("Post installation steps failed with error: {0}", exception.Message));
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ namespace Orchard.Environment.Extensions.Compilers {
|
|||||||
context.AssemblyBuilder.AddAssemblyReference(assembly);
|
context.AssemblyBuilder.AddAssemblyReference(assembly);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_criticalErrorProvider.Clear();
|
||||||
|
|
||||||
// Load references specified in project file (only the ones not yet loaded)
|
// Load references specified in project file (only the ones not yet loaded)
|
||||||
foreach (var assemblyReference in projectFileDescriptor.References) {
|
foreach (var assemblyReference in projectFileDescriptor.References) {
|
||||||
if (addedReferences.Contains(assemblyReference.SimpleName))
|
if (addedReferences.Contains(assemblyReference.SimpleName))
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ using Orchard.Localization;
|
|||||||
|
|
||||||
namespace Orchard.Environment.Extensions {
|
namespace Orchard.Environment.Extensions {
|
||||||
public class DefaultCriticalErrorProvider : ICriticalErrorProvider {
|
public class DefaultCriticalErrorProvider : ICriticalErrorProvider {
|
||||||
private readonly ConcurrentBag<LocalizedString> _errorMessages;
|
private ConcurrentBag<LocalizedString> _errorMessages;
|
||||||
|
private readonly object _synLock = new object();
|
||||||
|
|
||||||
public DefaultCriticalErrorProvider() {
|
public DefaultCriticalErrorProvider() {
|
||||||
_errorMessages = new ConcurrentBag<LocalizedString>();
|
_errorMessages = new ConcurrentBag<LocalizedString>();
|
||||||
@@ -22,5 +23,11 @@ namespace Orchard.Environment.Extensions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Clear() {
|
||||||
|
lock (_synLock) {
|
||||||
|
_errorMessages = new ConcurrentBag<LocalizedString>();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,5 +9,11 @@ namespace Orchard.Environment.Extensions {
|
|||||||
/// Called by any to notice the system of a critical issue at the system level, e.g. incorrect extensions
|
/// Called by any to notice the system of a critical issue at the system level, e.g. incorrect extensions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void RegisterErrorMessage(LocalizedString message);
|
void RegisterErrorMessage(LocalizedString message);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Removes all error message
|
||||||
|
/// </summary>
|
||||||
|
void Clear();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user