mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-22 20:13:50 +08:00
Preventing modules from breaking the website if a referenced assembly is missing
--HG-- branch : 1.x
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Localization;
|
||||
using Orchard.UI.Admin.Notification;
|
||||
using Orchard.UI.Notify;
|
||||
|
||||
namespace Orchard.Core.Dashboard.Services {
|
||||
public class CompilationErrorBanner : INotificationProvider {
|
||||
private readonly ICriticalErrorProvider _errorProvider;
|
||||
|
||||
public CompilationErrorBanner(ICriticalErrorProvider errorProvider) {
|
||||
_errorProvider = errorProvider;
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public IEnumerable<NotifyEntry> GetNotifications() {
|
||||
return _errorProvider.GetErrors()
|
||||
.Select(message => new NotifyEntry { Message = message, Type = NotifyType.Error });
|
||||
}
|
||||
}
|
||||
}
|
@@ -124,6 +124,7 @@
|
||||
<Compile Include="Contents\Settings\ContentPartSettings.cs" />
|
||||
<Compile Include="Contents\Shapes.cs" />
|
||||
<Compile Include="Contents\ViewModels\PublishContentViewModel.cs" />
|
||||
<Compile Include="Dashboard\Services\CompilationErrorBanner.cs" />
|
||||
<Compile Include="Navigation\Commands\MenuCommands.cs" />
|
||||
<Compile Include="Navigation\Drivers\AdminMenuPartDriver.cs" />
|
||||
<Compile Include="Navigation\Handlers\AdminMenuPartHandler.cs" />
|
||||
|
@@ -1 +1 @@
|
||||
<div class="message message-@Model.Type">@Model.Message</div>
|
||||
<div class="message message-@Model.Type">@Html.Raw(Html.Encode(Model.Message).Replace("\n", "<br />"))</div>
|
||||
|
Reference in New Issue
Block a user